From 77d8c9df6de814d5bac334c39b1ce37e0b28073c Mon Sep 17 00:00:00 2001 From: Marcelo Luiz Onhate Date: Mon, 10 Oct 2022 19:57:44 -0300 Subject: [PATCH] feat: custom load balancer ARN (#62) * feat: custom lb arn * pre-commit trigger * re-trigger pre-commit --- README.md | 3 ++- main.tf | 1 + variables.tf | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 801fa2a..3e2851f 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ No providers. | Name | Source | Version | |------|--------|---------| | [ecs-cluster](#module\_ecs-cluster) | cn-terraform/ecs-cluster/aws | 1.0.10 | -| [ecs-fargate-service](#module\_ecs-fargate-service) | cn-terraform/ecs-fargate-service/aws | 2.0.34 | +| [ecs-fargate-service](#module\_ecs-fargate-service) | cn-terraform/ecs-fargate-service/aws | 2.0.35 | | [td](#module\_td) | cn-terraform/ecs-fargate-task-definition/aws | 1.0.30 | ## Resources @@ -68,6 +68,7 @@ No resources. | [container\_memory](#input\_container\_memory) | (Optional) The amount of memory (in MiB) to allow the container to use. This is a hard limit, if the container attempts to exceed the container\_memory, the container is killed. This field is optional for Fargate launch type and the total amount of container\_memory of all containers in a task will need to be lower than the task memory value | `number` | `4096` | no | | [container\_memory\_reservation](#input\_container\_memory\_reservation) | (Optional) The amount of memory (in MiB) to reserve for the container. If container needs to exceed this threshold, it can do so up to the set container\_memory hard limit | `number` | `2048` | no | | [container\_name](#input\_container\_name) | The name of the container. Up to 255 characters ([a-z], [A-Z], [0-9], -, \_ allowed) | `string` | n/a | yes | +| [custom\_lb\_arn](#input\_custom\_lb\_arn) | ARN of the Load Balancer to use in the ECS service. If provided, this module will not create a load balancer and will use the one provided in this variable | `string` | `null` | no | | [default\_certificate\_arn](#input\_default\_certificate\_arn) | (Optional) The ARN of the default SSL server certificate. Required if var.https\_ports is set. | `string` | `null` | no | | [deployment\_maximum\_percent](#input\_deployment\_maximum\_percent) | (Optional) The upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. | `number` | `200` | no | | [deployment\_minimum\_healthy\_percent](#input\_deployment\_minimum\_healthy\_percent) | (Optional) The lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment. | `number` | `100` | no | diff --git a/main.tf b/main.tf index e5d7d81..e56a1d8 100644 --- a/main.tf +++ b/main.tf @@ -109,6 +109,7 @@ module "ecs-fargate-service" { ecs_cluster_name = module.ecs-cluster.aws_ecs_cluster_cluster_name # Application Load Balancer + custom_lb_arn = var.custom_lb_arn lb_internal = var.lb_internal lb_security_groups = var.lb_security_groups lb_drop_invalid_header_fields = var.lb_drop_invalid_header_fields diff --git a/variables.tf b/variables.tf index 6cfa074..f10452c 100644 --- a/variables.tf +++ b/variables.tf @@ -497,6 +497,12 @@ variable "assign_public_ip" { #------------------------------------------------------------------------------ # APPLICATION LOAD BALANCER #------------------------------------------------------------------------------ +variable "custom_lb_arn" { + description = "ARN of the Load Balancer to use in the ECS service. If provided, this module will not create a load balancer and will use the one provided in this variable" + type = string + default = null +} + variable "lb_internal" { description = "(Optional) If true, the LB will be internal." type = bool