|
6 | 6 | # Create tags_asg list from tags map. If possible |
7 | 7 | # New input tags_asg -> tags_asg with standard tags added |
8 | 8 |
|
9 | | -module "autoscaling_group" { |
10 | | - source = "devops-workflow/boolean/local" |
11 | | - version = "0.1.1" |
12 | | - value = "${var.autoscaling_group}" |
13 | | -} |
14 | | - |
15 | 9 | module "namespace-env" { |
16 | 10 | source = "devops-workflow/boolean/local" |
17 | 11 | version = "0.1.1" |
@@ -73,52 +67,4 @@ locals { |
73 | 67 | "Terraform", "true" |
74 | 68 | ) |
75 | 69 | )}" |
76 | | - |
77 | | - /* |
78 | | - tags_asg = ["${ concat( |
79 | | - list( |
80 | | - map("key", "Name", |
81 | | - "value", var.namespaced ? format("%s-%s", var.environment, var.name) |
82 | | - : format("%s", var.name), "propagate_at_launch", true), |
83 | | - map("key", "Cluster", |
84 | | - "value", var.namespaced ? format("%s-%s", var.environment, var.name) |
85 | | - : format("%s", var.name), "propagate_at_launch", true), |
86 | | - map("key", "Environment", "value", var.environment, "propagate_at_launch", true), |
87 | | - map("key", "Terraform", "value", "true", "propagate_at_launch", true) |
88 | | - ), |
89 | | - var.tags_asg) |
90 | | - }"] |
91 | | -*/ |
92 | | -} |
93 | | - |
94 | | -/* Try template_file, it supports count |
95 | | - Can only assign a single value (NOT maps or lists) |
96 | | -data "template_file" "asg_tags" { |
97 | | - count = "${var.autoscaling_group ? length(keys(local.tags)) : 0}" |
98 | | - template = "${map("key", element(keys(local.tags),count.index), "value", element(values(local.tags),count.index), "propagate_at_launch", true)}" |
99 | 70 | } |
100 | | -#"${data.template_file.data_id.*.rendered}" |
101 | | -/**/ |
102 | | - |
103 | | - |
104 | | -/* Could use null_resource to create? Would need enable/disable so only done when needed |
105 | | - Can only assign strings (NOT maps or lists) |
106 | | -resource "null_resource" "asg_tags" { |
107 | | - count = "${var.autoscaling_group ? length(keys(local.tags)) : 0}" |
108 | | - triggers = { |
109 | | - asg_tag = "${map("key", element(keys(local.tags),count.index), "value", element(values(local.tags),count.index), "propagate_at_launch", true)}" |
110 | | - } |
111 | | - lifecycle { |
112 | | - create_before_destroy = true |
113 | | - } |
114 | | -} |
115 | | -*/ |
116 | | - |
117 | | - |
118 | | -/* locals doesn't currently support count |
119 | | -locals { |
120 | | - count = "${length(keys(local.tags))}" |
121 | | - tag_asg = "${map("key", element(keys(local.tags),count.index), "value", element(values(local.tags),count.index), "propagate_at_launch", true)}" |
122 | | -} |
123 | | -*/ |
124 | | - |
0 commit comments