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" {
79
79
delete_on_termination = true
80
80
}
81
81
82
+ tag_specifications {
83
+ resource_type = " instance"
84
+ tags = local. common_tags
85
+ }
86
+
82
87
user_data = base64encode (join (" \n " , [
83
88
" #cloud-config" ,
84
89
yamlencode ({
@@ -106,9 +111,7 @@ resource "aws_launch_template" "this" {
106
111
]))
107
112
108
113
description = " Launch template for NAT instance ${ var . name } "
109
- tags = {
110
- Name = " nat-instance-${ var . name } "
111
- }
114
+ tags = local. common_tags
112
115
}
113
116
114
117
resource "aws_autoscaling_group" "this" {
@@ -137,23 +140,15 @@ resource "aws_autoscaling_group" "this" {
137
140
}
138
141
}
139
142
140
- // Generate asg tags from default tag list
141
143
dynamic "tag" {
142
- for_each = var . tags
144
+ for_each = local . common_tags
143
145
content {
144
146
key = tag. key
145
147
value = tag. value
146
- propagate_at_launch = true
148
+ propagate_at_launch = false
147
149
}
148
150
}
149
151
150
- // Tag for name
151
- tag {
152
- key = " Name"
153
- value = " nat-instance-${ var . name } "
154
- propagate_at_launch = true
155
- }
156
-
157
152
lifecycle {
158
153
create_before_destroy = true
159
154
}
You can’t perform that action at this time.
0 commit comments