This repository was archived by the owner on Jul 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,11 @@ resource "aws_launch_template" "this" {
7979 delete_on_termination = true
8080 }
8181
82+ tag_specifications {
83+ resource_type = " instance"
84+ tags = local. common_tags
85+ }
86+
8287 user_data = base64encode (join (" \n " , [
8388 " #cloud-config" ,
8489 yamlencode ({
@@ -106,9 +111,7 @@ resource "aws_launch_template" "this" {
106111 ]))
107112
108113 description = " Launch template for NAT instance ${ var . name } "
109- tags = {
110- Name = " nat-instance-${ var . name } "
111- }
114+ tags = local. common_tags
112115}
113116
114117resource "aws_autoscaling_group" "this" {
@@ -137,23 +140,15 @@ resource "aws_autoscaling_group" "this" {
137140 }
138141 }
139142
140- // Generate asg tags from default tag list
141143 dynamic "tag" {
142- for_each = var . tags
144+ for_each = local . common_tags
143145 content {
144146 key = tag. key
145147 value = tag. value
146- propagate_at_launch = true
148+ propagate_at_launch = false
147149 }
148150 }
149151
150- // Tag for name
151- tag {
152- key = " Name"
153- value = " nat-instance-${ var . name } "
154- propagate_at_launch = true
155- }
156-
157152 lifecycle {
158153 create_before_destroy = true
159154 }
You can’t perform that action at this time.
0 commit comments