From b2d1dadfe726c781fa5230c1492d6010d2dde5e4 Mon Sep 17 00:00:00 2001 From: siddharth-singh1 Date: Mon, 9 Dec 2024 06:59:25 +0000 Subject: [PATCH] Push pre-commit changes --- .terraform.lock.hcl | 1 + README.md | 16 ++++++++-------- example/.terraform.lock.hcl | 1 + modules/alb/.terraform.lock.hcl | 25 +++++++++++++++++++++++++ modules/ecs_cluster/.terraform.lock.hcl | 25 +++++++++++++++++++++++++ modules/ecs_service/.terraform.lock.hcl | 25 +++++++++++++++++++++++++ modules/ecs_service/locals.tf | 2 +- modules/ecs_service/variable.tf | 2 +- version.tf | 2 +- 9 files changed, 88 insertions(+), 11 deletions(-) create mode 100644 modules/alb/.terraform.lock.hcl create mode 100644 modules/ecs_cluster/.terraform.lock.hcl create mode 100644 modules/ecs_service/.terraform.lock.hcl diff --git a/.terraform.lock.hcl b/.terraform.lock.hcl index dac6f65..ff2c1c7 100644 --- a/.terraform.lock.hcl +++ b/.terraform.lock.hcl @@ -5,6 +5,7 @@ provider "registry.terraform.io/hashicorp/aws" { version = "5.80.0" constraints = "~> 5.0" hashes = [ + "h1:N5Wfsf4xe5DJfSeo0G/ulkIxzyfmUIoSj/hAiZ2DaKU=", "h1:q2pqSs7uPWvxunrBYjyirXARlxFIoxn2Lju42uJbxk4=", "zh:0b1655e39639d60f2de2860a5df8642f9556ba0ca04529c1b861fde4935cb0df", "zh:13dc0155e0a11edceee29ce687fc04c5a5a85f3324c67556472713cfd52e5807", diff --git a/README.md b/README.md index be2b8d5..4aa9d87 100644 --- a/README.md +++ b/README.md @@ -133,17 +133,17 @@ No resources. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [alb](#input\_alb) | Configuration settings for the Application Load Balancer (ALB). This includes attributes related to the ALB itself, such as its name, port, protocol, and other optional settings like access logs and tags. |
object({
name = optional(string, null)
port = optional(number)
protocol = optional(string, "HTTP")
internal = optional(bool, false)
load_balancer_type = optional(string, "application")
idle_timeout = optional(number, 60)
enable_deletion_protection = optional(bool, false)
enable_http2 = optional(bool, true)
certificate_arn = optional(string, null)

access_logs = optional(object({
bucket = string
enabled = optional(bool, false)
prefix = optional(string, "")
}))

tags = optional(map(string), {})
})
| n/a | yes | -| [alb\_target\_group](#input\_alb\_target\_group) | List of target groups to create |
list(object({
name = optional(string, "target-group")
port = number
protocol = optional(string, null)
protocol_version = optional(string, "HTTP1")
vpc_id = optional(string, "")
target_type = optional(string, "ip")
ip_address_type = optional(string, "ipv4")
load_balancing_algorithm_type = optional(string, "round_robin")
load_balancing_cross_zone_enabled = optional(string, "use_load_balancer_configuration")
deregistration_delay = optional(number, 300)
slow_start = optional(number, 0)
tags = optional(map(string), {})

health_check = optional(object({
enabled = optional(bool, true)
protocol = optional(string, "HTTP")
path = optional(string, "/")
port = optional(string, "traffic-port")
timeout = optional(number, 6)
healthy_threshold = optional(number, 3)
unhealthy_threshold = optional(number, 3)
interval = optional(number, 30)
matcher = optional(string, "200")
}))

stickiness = optional(object({
enabled = optional(bool, true)
type = string
cookie_duration = optional(number, 86400)
})
)

}))
| n/a | yes | -| [capacity\_provider](#input\_capacity\_provider) | Configuration settings for the ECS capacity providers, including the capacity providers used for autoscaling and Fargate. This variable defines the properties of each capacity provider and how they are managed, such as scaling policies and termination protection. |
object({
autoscaling_capacity_providers = map(object({
name = optional(string)
auto_scaling_group_arn = string
managed_termination_protection = optional(string, "DISABLED")
managed_draining = optional(string, "ENABLED")
managed_scaling = optional(object({
instance_warmup_period = optional(number)
maximum_scaling_step_size = optional(number)
minimum_scaling_step_size = optional(number)
status = optional(string)
target_capacity = optional(number)
}))
tags = optional(map(string), {})
}))
default_capacity_provider_use_fargate = bool
fargate_capacity_providers = any
})
| n/a | yes | +| [alb](#input\_alb) | Configuration settings for the Application Load Balancer (ALB). This includes attributes related to the ALB itself, such as its name, port, protocol, and other optional settings like access logs and tags. |
object({
name = optional(string, null)
port = optional(number)
protocol = optional(string, "HTTP")
internal = optional(bool, false)
load_balancer_type = optional(string, "application")
idle_timeout = optional(number, 60)
enable_deletion_protection = optional(bool, false)
enable_http2 = optional(bool, true)
certificate_arn = optional(string, null)

access_logs = optional(object({
bucket = string
enabled = optional(bool, false)
prefix = optional(string, "")
}))

tags = optional(map(string), {})
})
| n/a | yes | +| [alb\_target\_group](#input\_alb\_target\_group) | List of target groups to create |
list(object({
name = optional(string, "target-group")
port = number
protocol = optional(string, null)
protocol_version = optional(string, "HTTP1")
vpc_id = optional(string, "")
target_type = optional(string, "ip")
ip_address_type = optional(string, "ipv4")
load_balancing_algorithm_type = optional(string, "round_robin")
load_balancing_cross_zone_enabled = optional(string, "use_load_balancer_configuration")
deregistration_delay = optional(number, 300)
slow_start = optional(number, 0)
tags = optional(map(string), {})

health_check = optional(object({
enabled = optional(bool, true)
protocol = optional(string, "HTTP")
path = optional(string, "/")
port = optional(string, "traffic-port")
timeout = optional(number, 6)
healthy_threshold = optional(number, 3)
unhealthy_threshold = optional(number, 3)
interval = optional(number, 30)
matcher = optional(string, "200")
}))

stickiness = optional(object({
enabled = optional(bool, true)
type = string
cookie_duration = optional(number, 86400)
})
)

}))
| n/a | yes | +| [capacity\_provider](#input\_capacity\_provider) | Configuration settings for the ECS capacity providers, including the capacity providers used for autoscaling and Fargate. This variable defines the properties of each capacity provider and how they are managed, such as scaling policies and termination protection. |
object({
autoscaling_capacity_providers = map(object({
name = optional(string)
auto_scaling_group_arn = string
managed_termination_protection = optional(string, "DISABLED")
managed_draining = optional(string, "ENABLED")
managed_scaling = optional(object({
instance_warmup_period = optional(number)
maximum_scaling_step_size = optional(number)
minimum_scaling_step_size = optional(number)
status = optional(string)
target_capacity = optional(number)
}))
tags = optional(map(string), {})
}))
default_capacity_provider_use_fargate = bool
fargate_capacity_providers = any
})
| n/a | yes | | [create\_alb](#input\_create\_alb) | Flag to create or skip the creation of ALB | `bool` | `false` | no | | [create\_service](#input\_create\_service) | Flag to create or skip the creation of ECS demo service | `bool` | `false` | no | -| [ecs\_cluster](#input\_ecs\_cluster) | The ECS-specific values to use such as cluster, service, and repository names.

Keys:
- cluster\_name: The name of the ECS cluster.
- cluster\_configuration: The execute command configuration for the cluster.
- cluster\_settings: A list of cluster settings (e.g., container insights). Default is an empty list.
- cluster\_service\_connect\_defaults: Configures a default Service Connect namespace.
- create\_cloudwatch\_log\_group: Boolean flag to specify whether to create a CloudWatch log group for the ECS cluster. |
object({
name = string
configuration = optional(object({
execute_command_configuration = optional(object({
kms_key_id = optional(string, "")
logging = optional(string, "DEFAULT")
log_configuration = optional(object({
cloudwatch_encryption_enabled = optional(bool, null)
log_group_name = optional(string, null)
log_group_retention_in_days = optional(number, null)
log_group_kms_key_id = optional(string, null)
log_group_tags = optional(map(string), null)
s3_bucket_name = optional(string, null)
s3_bucket_encryption_enabled = optional(bool, null)
s3_key_prefix = optional(string, null)
}), {})
}), {})
}), {})
create_cloudwatch_log_group = bool
service_connect_defaults = optional(map(string), null)
settings = optional(any, null)
tags = optional(map(string), null)
})
| n/a | yes | -| [ecs\_service](#input\_ecs\_service) | The ECS-specific values to use such as cluster, service, and repository names. |
object({
cluster_name = string
service_name = string
repository_name = string
enable_load_balancer = bool
aws_lb_target_group_name = optional(string)
})
| n/a | yes | +| [ecs\_cluster](#input\_ecs\_cluster) | The ECS-specific values to use such as cluster, service, and repository names.

Keys:
- cluster\_name: The name of the ECS cluster.
- cluster\_configuration: The execute command configuration for the cluster.
- cluster\_settings: A list of cluster settings (e.g., container insights). Default is an empty list.
- cluster\_service\_connect\_defaults: Configures a default Service Connect namespace.
- create\_cloudwatch\_log\_group: Boolean flag to specify whether to create a CloudWatch log group for the ECS cluster. |
object({
name = string
configuration = optional(object({
execute_command_configuration = optional(object({
kms_key_id = optional(string, "")
logging = optional(string, "DEFAULT")
log_configuration = optional(object({
cloudwatch_encryption_enabled = optional(bool, null)
log_group_name = optional(string, null)
log_group_retention_in_days = optional(number, null)
log_group_kms_key_id = optional(string, null)
log_group_tags = optional(map(string), null)
s3_bucket_name = optional(string, null)
s3_bucket_encryption_enabled = optional(bool, null)
s3_key_prefix = optional(string, null)
}), {})
}), {})
}), {})
create_cloudwatch_log_group = bool
service_connect_defaults = optional(map(string), null)
settings = optional(any, null)
tags = optional(map(string), null)
})
| n/a | yes | +| [ecs\_service](#input\_ecs\_service) | The ECS-specific values to use such as cluster, service, and repository names. |
object({
cluster_name = string
service_name = string
repository_name = string
enable_load_balancer = bool
aws_lb_target_group_name = optional(string)
})
| n/a | yes | | [environment](#input\_environment) | The environment associated with the ECS service | `string` | n/a | yes | -| [lb](#input\_lb) | ALB-related information (listening port, deletion protection, security group) |
object({
name = string
listener_port = number
deregistration_delay = optional(number)
security_group_id = string
})
| n/a | yes | -| [listener\_rules](#input\_listener\_rules) | List of listener rules to create |
list(object({
priority = number

conditions = list(object({
field = string
values = list(string)
}))

actions = list(object({
type = string
target_group_arn = optional(string)
order = optional(number)
redirect = optional(object({
protocol = string
port = string
host = optional(string)
path = optional(string)
query = optional(string)
status_code = string
}), null)

fixed_response = optional(object({
content_type = string
message_body = optional(string)
status_code = optional(string)
}), null)
}))
}))
| n/a | yes | -| [task](#input\_task) | Task-related information (vCPU, memory, # of tasks, port, and health check info.) |
object({
tasks_desired = optional(number)
container_vcpu = optional(number)
container_memory = optional(number)
container_port = number
container_health_check_path = optional(string)
container_definition = optional(string)
environment_variables = optional(map(string))
task_execution_role = optional(string)
})
| n/a | yes | +| [lb](#input\_lb) | ALB-related information (listening port, deletion protection, security group) |
object({
name = string
listener_port = number
deregistration_delay = optional(number)
security_group_id = string
})
| n/a | yes | +| [listener\_rules](#input\_listener\_rules) | List of listener rules to create |
list(object({
priority = number

conditions = list(object({
field = string
values = list(string)
}))

actions = list(object({
type = string
target_group_arn = optional(string)
order = optional(number)
redirect = optional(object({
protocol = string
port = string
host = optional(string)
path = optional(string)
query = optional(string)
status_code = string
}), null)

fixed_response = optional(object({
content_type = string
message_body = optional(string)
status_code = optional(string)
}), null)
}))
}))
| n/a | yes | +| [task](#input\_task) | Task-related information (vCPU, memory, # of tasks, port, and health check info.) |
object({
tasks_desired = optional(number)
container_vcpu = optional(number)
container_memory = optional(number)
container_port = number
container_health_check_path = optional(string)
container_definition = optional(string)
environment_variables = optional(map(string))
task_execution_role = optional(string)
})
| n/a | yes | | [vpc\_id](#input\_vpc\_id) | ID of VPC in which all resources need to be created | `string` | n/a | yes | ## Outputs diff --git a/example/.terraform.lock.hcl b/example/.terraform.lock.hcl index dac6f65..ff2c1c7 100644 --- a/example/.terraform.lock.hcl +++ b/example/.terraform.lock.hcl @@ -5,6 +5,7 @@ provider "registry.terraform.io/hashicorp/aws" { version = "5.80.0" constraints = "~> 5.0" hashes = [ + "h1:N5Wfsf4xe5DJfSeo0G/ulkIxzyfmUIoSj/hAiZ2DaKU=", "h1:q2pqSs7uPWvxunrBYjyirXARlxFIoxn2Lju42uJbxk4=", "zh:0b1655e39639d60f2de2860a5df8642f9556ba0ca04529c1b861fde4935cb0df", "zh:13dc0155e0a11edceee29ce687fc04c5a5a85f3324c67556472713cfd52e5807", diff --git a/modules/alb/.terraform.lock.hcl b/modules/alb/.terraform.lock.hcl new file mode 100644 index 0000000..a5e800b --- /dev/null +++ b/modules/alb/.terraform.lock.hcl @@ -0,0 +1,25 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "5.80.0" + constraints = "~> 5.0" + hashes = [ + "h1:N5Wfsf4xe5DJfSeo0G/ulkIxzyfmUIoSj/hAiZ2DaKU=", + "zh:0b1655e39639d60f2de2860a5df8642f9556ba0ca04529c1b861fde4935cb0df", + "zh:13dc0155e0a11edceee29ce687fc04c5a5a85f3324c67556472713cfd52e5807", + "zh:180f6cb2be44be14cfe329e0649121b774319f083b6e4e8fb749f85090d73121", + "zh:3158d44b74c67465f7f19f22c42b643840c8d18ce833e2ec86e8d93085b06926", + "zh:6351b5bf7cde5dc83e926944891570636069e05ca43341f4d1feda67773469bf", + "zh:6fa9db1532096ba50e842d369b6688979306d2295c7ead49b8a266b0d60962cc", + "zh:85d2fe75def7619ff2cc29102048875039cad088fafb62ecc14c3763e7b1e9d9", + "zh:9028d653f1d7341c6dfe2afe961b6541581e9043a474eac2faf90e6426a24f6d", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:9c4e248c442bc60f07f9f089e5361f19936833370dc3c04b27916672b765f0e1", + "zh:a710a3979596e3f3938c3ec6bb748e604724d3a4afa96ed2c14f0a245cc41a11", + "zh:c27936bdf447779d0c0833bf52a9ef618985f5ea8e3e243d6266513520ca31c4", + "zh:c7681134a123486e72eaedc3f8d2d75e267dbbfd45fa7de5aea8f757af57f89b", + "zh:ea717ebad3561fd02591f9eecf30f3df5635405556fba2bdbf29fd42691bebac", + "zh:f4e1e8f23c58c3e8f4371f9c3379a723ab4155246e6b6daad8eb99e16666b2cb", + ] +} diff --git a/modules/ecs_cluster/.terraform.lock.hcl b/modules/ecs_cluster/.terraform.lock.hcl new file mode 100644 index 0000000..a5e800b --- /dev/null +++ b/modules/ecs_cluster/.terraform.lock.hcl @@ -0,0 +1,25 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "5.80.0" + constraints = "~> 5.0" + hashes = [ + "h1:N5Wfsf4xe5DJfSeo0G/ulkIxzyfmUIoSj/hAiZ2DaKU=", + "zh:0b1655e39639d60f2de2860a5df8642f9556ba0ca04529c1b861fde4935cb0df", + "zh:13dc0155e0a11edceee29ce687fc04c5a5a85f3324c67556472713cfd52e5807", + "zh:180f6cb2be44be14cfe329e0649121b774319f083b6e4e8fb749f85090d73121", + "zh:3158d44b74c67465f7f19f22c42b643840c8d18ce833e2ec86e8d93085b06926", + "zh:6351b5bf7cde5dc83e926944891570636069e05ca43341f4d1feda67773469bf", + "zh:6fa9db1532096ba50e842d369b6688979306d2295c7ead49b8a266b0d60962cc", + "zh:85d2fe75def7619ff2cc29102048875039cad088fafb62ecc14c3763e7b1e9d9", + "zh:9028d653f1d7341c6dfe2afe961b6541581e9043a474eac2faf90e6426a24f6d", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:9c4e248c442bc60f07f9f089e5361f19936833370dc3c04b27916672b765f0e1", + "zh:a710a3979596e3f3938c3ec6bb748e604724d3a4afa96ed2c14f0a245cc41a11", + "zh:c27936bdf447779d0c0833bf52a9ef618985f5ea8e3e243d6266513520ca31c4", + "zh:c7681134a123486e72eaedc3f8d2d75e267dbbfd45fa7de5aea8f757af57f89b", + "zh:ea717ebad3561fd02591f9eecf30f3df5635405556fba2bdbf29fd42691bebac", + "zh:f4e1e8f23c58c3e8f4371f9c3379a723ab4155246e6b6daad8eb99e16666b2cb", + ] +} diff --git a/modules/ecs_service/.terraform.lock.hcl b/modules/ecs_service/.terraform.lock.hcl new file mode 100644 index 0000000..a5e800b --- /dev/null +++ b/modules/ecs_service/.terraform.lock.hcl @@ -0,0 +1,25 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/aws" { + version = "5.80.0" + constraints = "~> 5.0" + hashes = [ + "h1:N5Wfsf4xe5DJfSeo0G/ulkIxzyfmUIoSj/hAiZ2DaKU=", + "zh:0b1655e39639d60f2de2860a5df8642f9556ba0ca04529c1b861fde4935cb0df", + "zh:13dc0155e0a11edceee29ce687fc04c5a5a85f3324c67556472713cfd52e5807", + "zh:180f6cb2be44be14cfe329e0649121b774319f083b6e4e8fb749f85090d73121", + "zh:3158d44b74c67465f7f19f22c42b643840c8d18ce833e2ec86e8d93085b06926", + "zh:6351b5bf7cde5dc83e926944891570636069e05ca43341f4d1feda67773469bf", + "zh:6fa9db1532096ba50e842d369b6688979306d2295c7ead49b8a266b0d60962cc", + "zh:85d2fe75def7619ff2cc29102048875039cad088fafb62ecc14c3763e7b1e9d9", + "zh:9028d653f1d7341c6dfe2afe961b6541581e9043a474eac2faf90e6426a24f6d", + "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", + "zh:9c4e248c442bc60f07f9f089e5361f19936833370dc3c04b27916672b765f0e1", + "zh:a710a3979596e3f3938c3ec6bb748e604724d3a4afa96ed2c14f0a245cc41a11", + "zh:c27936bdf447779d0c0833bf52a9ef618985f5ea8e3e243d6266513520ca31c4", + "zh:c7681134a123486e72eaedc3f8d2d75e267dbbfd45fa7de5aea8f757af57f89b", + "zh:ea717ebad3561fd02591f9eecf30f3df5635405556fba2bdbf29fd42691bebac", + "zh:f4e1e8f23c58c3e8f4371f9c3379a723ab4155246e6b6daad8eb99e16666b2cb", + ] +} diff --git a/modules/ecs_service/locals.tf b/modules/ecs_service/locals.tf index c1b999b..8ae521d 100644 --- a/modules/ecs_service/locals.tf +++ b/modules/ecs_service/locals.tf @@ -16,4 +16,4 @@ locals { Value = value }] -} \ No newline at end of file +} diff --git a/modules/ecs_service/variable.tf b/modules/ecs_service/variable.tf index 77f145a..e3d9ee3 100644 --- a/modules/ecs_service/variable.tf +++ b/modules/ecs_service/variable.tf @@ -44,4 +44,4 @@ variable "lb" { security_group_id = string }) description = "ALB-related information (listening port, deletion protection, security group)" -} \ No newline at end of file +} diff --git a/version.tf b/version.tf index b5b9c5a..59c42e8 100644 --- a/version.tf +++ b/version.tf @@ -7,4 +7,4 @@ terraform { version = "~> 5.0" } } -} \ No newline at end of file +}