Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce5ea8d

Browse files
Merge pull request segmentio#27 from Edencia/main_stack_cluster_name
Correctly set the cluster name
2 parents 541da3f + b97f22a commit ce5ea8d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

main.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ variable "availability_zones" {
6060
default = "us-west-2a,us-west-2b,us-west-2c"
6161
}
6262

63+
variable "ecs_cluster_name" {
64+
description = "the name of the cluster, if not specified the variable name will be used"
65+
default = ""
66+
}
67+
6368
variable "ecs_instance_type" {
6469
description = "the instance type to use for your default ecs cluster"
6570
default = "m4.large"
@@ -174,7 +179,7 @@ module "iam_role" {
174179

175180
module "ecs_cluster" {
176181
source = "./ecs-cluster"
177-
name = "default"
182+
name = "${coalesce(var.ecs_cluster_name, var.name)}"
178183
environment = "${var.environment}"
179184
vpc_id = "${module.vpc.id}"
180185
image_id = "${coalesce(var.ecs_ami, module.defaults.ecs_ami)}"

0 commit comments

Comments
 (0)