From 21db5d16f83644103498c8de801d6c4809dbee6b Mon Sep 17 00:00:00 2001 From: uvalchkou Date: Tue, 23 Jun 2020 18:10:58 +0300 Subject: [PATCH] added container_name variable --- README.md | 2 +- ecs-cluster.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b2939a..6f79c83 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ EOF | container\_cpu | Amount of cpu used by the task | string | `512` | no | | container\_definitions | Fargate container definition | string | see default value bellow this table | no | | container\_memory | Amount of memory used by the task | string | `1024` | no | -| container\_name | Defines container name which will be used as target in ALB target group. If not set ${var.project}-${var.service} value will be used. | string | `` | no | +| container\_name | Defines container name which will be used as target in ALB target group. If not set ${var.service}-${var.environment} value will be used. | string | `` | no | | container\_port | exposed port in container | string | `80` | no | | ecs\_cluster\_id | ID of existing ECS cluster (if want to attach service and etc to existing cluster) | string | `none` | no | | environment | Environment name is used to identify resources | string | `env` | no | diff --git a/ecs-cluster.tf b/ecs-cluster.tf index 4c3e56c..cb5b643 100644 --- a/ecs-cluster.tf +++ b/ecs-cluster.tf @@ -51,7 +51,7 @@ resource "aws_ecs_service" "this" { load_balancer { target_group_arn = "${var.alb_target_group_arn}" - container_name = "${var.container_name == "" ? var.service-var.environment : var.container_name}" + container_name = "${var.container_name == "" ? "${var.service}-${var.environment}" : var.container_name}" container_port = "${var.container_port}" }