Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/infraspecdev/terraform-aws-ecs-deployment

Terraform module to deploy production-ready applications and services on an existing ECS infra.
https://github.com/infraspecdev/terraform-aws-ecs-deployment

aws-acm aws-alb aws-ecs aws-ecs-capac ecs-deployment terraform-aws-module terraform-module

Last synced: about 19 hours ago
JSON representation

Terraform module to deploy production-ready applications and services on an existing ECS infra.

Awesome Lists containing this project

README

        

# terraform-aws-ecs-deployment

Terraform module to deploy production-ready applications and services on an existing ECS infra.

## Architecture Diagram

![ECS Deployment Architecture Diagram](https://github.com/infraspecdev/terraform-aws-ecs-deployment/raw/main/diagrams/ecs-deployment-architecture.jpeg)

## Requirements

| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.6.0 |
| [aws](#requirement\_aws) | ~> 5.0 |

## Providers

| Name | Version |
|------|---------|
| [aws](#provider\_aws) | ~> 5.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| [acm](#module\_acm) | ./modules/acm | n/a |
| [alb](#module\_alb) | ./modules/alb | n/a |
| [capacity\_provider](#module\_capacity\_provider) | ./modules/capacity-provider | n/a |
| [s3\_bucket](#module\_s3\_bucket) | ./modules/s3-bucket | n/a |

## Resources

| Name | Type |
|------|------|
| [aws_ecs_service.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_service) | resource |
| [aws_ecs_task_definition.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_task_definition) | resource |
| [aws_elb_service_account.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/elb_service_account) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [acm\_certificates](#input\_acm\_certificates) | ACM certificates to create. |

map(object({
domain_name = string
subject_alternative_names = optional(list(string), [])
validation_method = optional(string, "DNS")
key_algorithm = optional(string, "RSA_2048")
validation_option = optional(object({
domain_name = string
validation_domain = string
}))
tags = optional(map(string), {})
record_zone_id = string
record_allow_overwrite = optional(bool, true)
}))
| `{}` | no |
| [capacity\_provider\_default\_auto\_scaling\_group\_arn](#input\_capacity\_provider\_default\_auto\_scaling\_group\_arn) | ARN for this Auto Scaling Group. | `string` | `null` | no |
| [capacity\_providers](#input\_capacity\_providers) | Capacity Providers to associate with the ECS Cluster. | `any` | `{}` | no |
| [cluster\_name](#input\_cluster\_name) | (Required) Name of the cluster. | `string` | n/a | yes |
| [create\_acm](#input\_create\_acm) | Creates the ACM certificates to use with the Load Balancer. | `bool` | `false` | no |
| [create\_alb](#input\_create\_alb) | Creates a new Application Load Balancer to use with the ECS Service. | `bool` | `true` | no |
| [create\_capacity\_provider](#input\_create\_capacity\_provider) | Creates a new Capacity Provider to use with the Autoscaling Group. | `bool` | `true` | no |
| [create\_s3\_bucket\_for\_alb\_logging](#input\_create\_s3\_bucket\_for\_alb\_logging) | (Optional) Creates S3 bucket for storing ALB Access and Connection Logs. | `bool` | `true` | no |
| [default\_capacity\_providers\_strategies](#input\_default\_capacity\_providers\_strategies) | (Optional) Set of capacity provider strategies to use by default for the cluster. | `any` | `[]` | no |
| [load\_balancer](#input\_load\_balancer) | Configuration for the Application Load Balancer. |
object({
name = optional(string)
internal = optional(bool, false)
subnets_ids = optional(list(string), [])
security_groups_ids = optional(list(string), [])
preserve_host_header = optional(bool)
enable_deletion_protection = optional(bool, false)
access_logs = optional(any, null)
connection_logs = optional(any, null)
target_groups = optional(any, {})
listeners = optional(any, {})
listener_rules = optional(any, {})
tags = optional(map(string), {})
})
| `{}` | no |
| [s3\_bucket\_force\_destroy](#input\_s3\_bucket\_force\_destroy) | (Optional, Default:false) Boolean that indicates all objects (including any locked objects) should be deleted from the bucket when the bucket is destroyed so that the bucket can be destroyed without error. | `bool` | `false` | no |
| [s3\_bucket\_name](#input\_s3\_bucket\_name) | (Optional, Forces new resource) Name of the bucket. | `string` | `null` | no |
| [s3\_bucket\_policy\_id\_prefix](#input\_s3\_bucket\_policy\_id\_prefix) | (Optional) - Prefix of the ID for the policy document. | `string` | `"ecs-deployment-alb-"` | no |
| [s3\_bucket\_tags](#input\_s3\_bucket\_tags) | (Optional) Map of tags to assign to the bucket. | `map(string)` | `{}` | no |
| [s3\_elb\_service\_account\_arn](#input\_s3\_elb\_service\_account\_arn) | (Optional, Default:null) ARN of the ELB Service Account. | `string` | `null` | no |
| [service](#input\_service) | Configuration for ECS Service. |
object({
name = string
deployment_maximum_percent = optional(number)
deployment_minimum_healthy_percent = optional(number)
desired_count = optional(number)
enable_ecs_managed_tags = optional(bool, true)
enable_execute_command = optional(bool)
force_new_deployment = optional(bool, true)
health_check_grace_period_seconds = optional(number)
iam_role = optional(string)
propagate_tags = optional(string)
scheduling_strategy = optional(string)
triggers = optional(map(string))
wait_for_steady_state = optional(bool)
load_balancer = optional(any, [])
network_configuration = optional(any, null)
service_connect_configuration = optional(any, null)
volume_configuration = optional(any, null)
deployment_circuit_breaker = optional(any, null)
service_registries = optional(any, null)
tags = optional(map(string), {})
})
| n/a | yes |
| [task\_definition](#input\_task\_definition) | ECS Task Definition to use for running tasks. |
object({
container_definitions = any
family = string
cpu = optional(string)
execution_role_arn = optional(string)
ipc_mode = optional(string)
memory = optional(string)
network_mode = optional(string, "awsvpc")
pid_mode = optional(string)
skip_destroy = optional(bool)
task_role_arn = optional(string)
track_latest = optional(bool)
runtime_platform = optional(any, null)
volume = optional(any, null)
tags = optional(map(string), {})
})
| n/a | yes |
| [vpc\_id](#input\_vpc\_id) | The ID of the VPC. | `string` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| [acm\_certificate\_validation\_id](#output\_acm\_certificate\_validation\_id) | Identifiers of the ACM certificates validation resources. |
| [acm\_certificates\_arns](#output\_acm\_certificates\_arns) | ARNs of the ACM certificates. |
| [acm\_certificates\_ids](#output\_acm\_certificates\_ids) | Identifiers of the ACM certificates. |
| [acm\_route53\_records\_ids](#output\_acm\_route53\_records\_ids) | Identifiers of the Route53 Records for validation of the ACM certificates. |
| [alb\_arn](#output\_alb\_arn) | ARN of the load balancer. |
| [alb\_dns\_name](#output\_alb\_dns\_name) | DNS name of the load balancer. |
| [alb\_listener\_rules\_arns](#output\_alb\_listener\_rules\_arns) | ARNs of the Listener Rules. |
| [alb\_listener\_rules\_ids](#output\_alb\_listener\_rules\_ids) | Identifiers of the Listener Rules. |
| [alb\_listeners\_arns](#output\_alb\_listeners\_arns) | ARNs of the Listeners. |
| [alb\_listeners\_ids](#output\_alb\_listeners\_ids) | Identifiers of the Listeners. |
| [alb\_target\_groups\_arns](#output\_alb\_target\_groups\_arns) | ARNs of the Target Groups. |
| [alb\_target\_groups\_ids](#output\_alb\_target\_groups\_ids) | Identifiers of the Target Groups. |
| [alb\_zone\_id](#output\_alb\_zone\_id) | Canonical hosted zone ID of the Load Balancer. |
| [capacity\_provider\_arns](#output\_capacity\_provider\_arns) | ARNs for the ECS Capacity Providers. |
| [capacity\_provider\_ecs\_cluster\_capacity\_providers\_id](#output\_capacity\_provider\_ecs\_cluster\_capacity\_providers\_id) | Identifier for the ECS Cluster Capacity Providers. |
| [capacity\_provider\_ids](#output\_capacity\_provider\_ids) | Identifiers for the ECS Capacity Providers. |
| [ecs\_service\_arn](#output\_ecs\_service\_arn) | ARN that identifies the service. |
| [ecs\_task\_definition\_arn](#output\_ecs\_task\_definition\_arn) | Full ARN of the Task Definition. |
| [s3\_bucket\_arn](#output\_s3\_bucket\_arn) | ARN of the bucket. |
| [s3\_bucket\_id](#output\_s3\_bucket\_id) | Name of the bucket. |