Skip to content

Commit

Permalink
added container_name variable
Browse files Browse the repository at this point in the history
  • Loading branch information
VladVolchkov committed Jun 23, 2020
1 parent 51c0ea3 commit 21db5d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion ecs-cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}

Expand Down

0 comments on commit 21db5d1

Please sign in to comment.