diff --git a/README.md b/README.md index 9b1f24d9..25936dbc 100644 --- a/README.md +++ b/README.md @@ -332,6 +332,7 @@ allow_github_webhooks = true | [essential](#input\_essential) | Determines whether all other containers in a task are stopped, if this container fails or stops for any reason. Due to how Terraform type casts booleans in json it is required to double quote this value | `bool` | `true` | no | | [external\_task\_definition\_updates](#input\_external\_task\_definition\_updates) | Enable to allow the task definition to be updated outside of this Terraform module. This should be enabled when using a deployment tool such as ecs-deploy which updates the task definition and will then keep the ECS service using the latest version of the task definition. | `bool` | `false` | no | | [extra\_container\_definitions](#input\_extra\_container\_definitions) | A list of valid container definitions provided as a single valid JSON document. These will be provided as supplimentary to the main Atlantis container definition | `list(any)` | `[]` | no | +| [extra\_load\_balancers](#input\_extra\_load\_balancers) | A list of maps for additional ECS task load balancers | `list(map(string))` | `[]` | no | | [firelens\_configuration](#input\_firelens\_configuration) | The FireLens configuration for the container. This is used to specify and configure a log router for container logs. For more details, see https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_FirelensConfiguration.html |
object({
type = string
options = map(string)
}) | `null` | no |
| [github\_webhooks\_cidr\_blocks](#input\_github\_webhooks\_cidr\_blocks) | List of CIDR blocks used by GitHub webhooks | `list(string)` | [| no | | [internal](#input\_internal) | Whether the load balancer is internal or external | `bool` | `false` | no | diff --git a/main.tf b/main.tf index 2b7ae08d..140d9630 100644 --- a/main.tf +++ b/main.tf @@ -645,6 +645,15 @@ resource "aws_ecs_service" "atlantis" { target_group_arn = element(module.alb.target_group_arns, 0) } + dynamic "load_balancer" { + for_each = var.extra_load_balancers + content { + container_name = load_balancer.value["container_name"] + container_port = load_balancer.value["container_port"] + target_group_arn = load_balancer.value["target_group_arn"] + } + } + dynamic "capacity_provider_strategy" { for_each = var.ecs_fargate_spot ? [true] : [] content { diff --git a/variables.tf b/variables.tf index c77a0c27..d4333222 100644 --- a/variables.tf +++ b/variables.tf @@ -174,6 +174,12 @@ variable "alb_listener_ssl_policy_default" { default = "ELBSecurityPolicy-2016-08" } +variable "extra_load_balancers" { + description = "A list of maps for additional ECS task load balancers" + type = list(map(string)) + default = [] +} + # ACM variable "certificate_arn" { description = "ARN of certificate issued by AWS ACM. If empty, a new ACM certificate will be created and validated using Route53 DNS"
"140.82.112.0/20",
"185.199.108.0/22",
"192.30.252.0/22",
"143.55.64.0/20"
]