Skip to content

Commit f6393c2

Browse files
grimm26antonbabenko
authored andcommitted
Launch configuration naming, tagging fix/clarity (terraform-aws-modules#11)
* remove unneeded concat of var.launch_configuration into name when create_lc is set, it does not matter what var.launch_configuration is set to, so dont concat it into aws_launch_configuration resource generated name. * add supplied tag blocks after name block so that all of the tags don't get rearranged every time one is added or removed.
1 parent f507160 commit f6393c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ resource "aws_autoscaling_group" "this" {
3333
count = "${var.create_asg}"
3434

3535
name_prefix = "${coalesce(var.asg_name, var.name)}-"
36-
launch_configuration = "${var.create_lc ? element(concat(aws_launch_configuration.this.*.id, list(var.launch_configuration)), 0) : var.launch_configuration}"
36+
launch_configuration = "${var.create_lc ? element(aws_launch_configuration.this.*.name, 0) : var.launch_configuration}"
3737
vpc_zone_identifier = ["${var.vpc_zone_identifier}"]
3838
max_size = "${var.max_size}"
3939
min_size = "${var.min_size}"
@@ -57,7 +57,7 @@ resource "aws_autoscaling_group" "this" {
5757
protect_from_scale_in = "${var.protect_from_scale_in}"
5858

5959
tags = ["${concat(
60-
var.tags,
61-
list(map("key", "Name", "value", var.name, "propagate_at_launch", true))
60+
list(map("key", "Name", "value", var.name, "propagate_at_launch", true)),
61+
var.tags
6262
)}"]
6363
}

0 commit comments

Comments
 (0)