Skip to content

Commit b6ed6c4

Browse files
author
Micah Huber
authored
Merge pull request #45 from reactiveops/mh/tagging
Add global tags
2 parents cd96d45 + d44602b commit b6ed6c4

5 files changed

+137
-0
lines changed

eip.tf

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
resource "aws_eip" "mod_nat" {
1616
count = "${((var.multi_az_nat_gateway * var.az_count) + (var.single_nat_gateway * 1))}"
17+
tags = "${var.global_tags}"
1718
vpc = true
1819
}
1920

nat-gateway.tf

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ resource "aws_nat_gateway" "nat_gateway" {
1616
count = "${((var.multi_az_nat_gateway * var.az_count) + (var.single_nat_gateway * 1))}"
1717
subnet_id = "${element(aws_subnet.public.*.id, count.index)}"
1818
allocation_id = "${element(aws_eip.mod_nat.*.id, count.index)}"
19+
tags = "${var.global_tags}"
1920
depends_on = ["aws_internet_gateway.default","aws_eip.mod_nat","aws_subnet.public"]
2021
lifecycle = {
2122
ignore_changes = ["tags"]

tests/fixtures/terraform.1az.tfvars.example.output

+21
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,19 @@ Terraform will perform the following actions:
1818
domain: <computed>
1919
instance: <computed>
2020
network_interface: <computed>
21+
private_dns: <computed>
2122
private_ip: <computed>
23+
public_dns: <computed>
2224
public_ip: <computed>
25+
public_ipv4_pool: <computed>
26+
tags.%: "2"
27+
tags.Author: "ReactiveOps"
28+
tags.Managed By: "Terraform"
2329
vpc: "true"
2430

2531
 + aws_internet_gateway.default
2632
 id: <computed>
33+
owner_id: <computed>
2734
tags.%: "3"
2835
tags.Author: "ReactiveOps"
2936
tags.Managed By: "Terraform"
@@ -37,6 +44,9 @@ Terraform will perform the following actions:
3744
private_ip: <computed>
3845
public_ip: <computed>
3946
subnet_id: "${element(aws_subnet.public.*.id, count.index)}"
47+
tags.%: "2"
48+
tags.Author: "ReactiveOps"
49+
tags.Managed By: "Terraform"
4050

4151
 + aws_route.private_nat_gateway
4252
 id: <computed>
@@ -68,6 +78,7 @@ Terraform will perform the following actions:
6878

6979
 + aws_route_table.private
7080
 id: <computed>
81+
owner_id: <computed>
7182
propagating_vgws.#: <computed>
7283
route.#: <computed>
7384
tags.%: "3"
@@ -78,6 +89,7 @@ Terraform will perform the following actions:
7889

7990
 + aws_route_table.public
8091
 id: <computed>
92+
owner_id: <computed>
8193
propagating_vgws.#: <computed>
8294
route.#: <computed>
8395
tags.%: "3"
@@ -111,10 +123,12 @@ Terraform will perform the following actions:
111123
arn: <computed>
112124
assign_ipv6_address_on_creation: "false"
113125
availability_zone: "us-east-1a"
126+
availability_zone_id: <computed>
114127
cidr_block: "10.21.0.0/21"
115128
ipv6_cidr_block: <computed>
116129
ipv6_cidr_block_association_id: <computed>
117130
map_public_ip_on_launch: "false"
131+
owner_id: <computed>
118132
tags.%: "3"
119133
tags.Author: "ReactiveOps"
120134
tags.Managed By: "Terraform"
@@ -126,10 +140,12 @@ Terraform will perform the following actions:
126140
arn: <computed>
127141
assign_ipv6_address_on_creation: "false"
128142
availability_zone: "us-east-1a"
143+
availability_zone_id: <computed>
129144
cidr_block: "10.21.64.0/21"
130145
ipv6_cidr_block: <computed>
131146
ipv6_cidr_block_association_id: <computed>
132147
map_public_ip_on_launch: "false"
148+
owner_id: <computed>
133149
tags.%: "3"
134150
tags.Author: "ReactiveOps"
135151
tags.Managed By: "Terraform"
@@ -141,10 +157,12 @@ Terraform will perform the following actions:
141157
arn: <computed>
142158
assign_ipv6_address_on_creation: "false"
143159
availability_zone: "us-east-1a"
160+
availability_zone_id: <computed>
144161
cidr_block: "10.21.96.0/21"
145162
ipv6_cidr_block: <computed>
146163
ipv6_cidr_block_association_id: <computed>
147164
map_public_ip_on_launch: "false"
165+
owner_id: <computed>
148166
tags.%: "3"
149167
tags.Author: "ReactiveOps"
150168
tags.Managed By: "Terraform"
@@ -156,10 +174,12 @@ Terraform will perform the following actions:
156174
arn: <computed>
157175
assign_ipv6_address_on_creation: "false"
158176
availability_zone: "us-east-1a"
177+
availability_zone_id: <computed>
159178
cidr_block: "10.21.32.0/21"
160179
ipv6_cidr_block: <computed>
161180
ipv6_cidr_block_association_id: <computed>
162181
map_public_ip_on_launch: "false"
182+
owner_id: <computed>
163183
tags.%: "3"
164184
tags.Author: "ReactiveOps"
165185
tags.Managed By: "Terraform"
@@ -183,6 +203,7 @@ Terraform will perform the following actions:
183203
ipv6_association_id: <computed>
184204
ipv6_cidr_block: <computed>
185205
main_route_table_id: <computed>
206+
owner_id: <computed>
186207
tags.%: "3"
187208
tags.Author: "ReactiveOps"
188209
tags.Managed By: "Terraform"

tests/fixtures/terraform.nat-gw.tfvars.example.output

+57
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ Terraform will perform the following actions:
1818
domain: <computed>
1919
instance: <computed>
2020
network_interface: <computed>
21+
private_dns: <computed>
2122
private_ip: <computed>
23+
public_dns: <computed>
2224
public_ip: <computed>
25+
public_ipv4_pool: <computed>
26+
tags.%: "2"
27+
tags.Author: "ReactiveOps"
28+
tags.Managed By: "Terraform"
2329
vpc: "true"
2430

2531
 + aws_eip.mod_nat[1]
@@ -29,8 +35,14 @@ Terraform will perform the following actions:
2935
domain: <computed>
3036
instance: <computed>
3137
network_interface: <computed>
38+
private_dns: <computed>
3239
private_ip: <computed>
40+
public_dns: <computed>
3341
public_ip: <computed>
42+
public_ipv4_pool: <computed>
43+
tags.%: "2"
44+
tags.Author: "ReactiveOps"
45+
tags.Managed By: "Terraform"
3446
vpc: "true"
3547

3648
 + aws_eip.mod_nat[2]
@@ -40,12 +52,19 @@ Terraform will perform the following actions:
4052
domain: <computed>
4153
instance: <computed>
4254
network_interface: <computed>
55+
private_dns: <computed>
4356
private_ip: <computed>
57+
public_dns: <computed>
4458
public_ip: <computed>
59+
public_ipv4_pool: <computed>
60+
tags.%: "2"
61+
tags.Author: "ReactiveOps"
62+
tags.Managed By: "Terraform"
4563
vpc: "true"
4664

4765
 + aws_internet_gateway.default
4866
 id: <computed>
67+
owner_id: <computed>
4968
tags.%: "3"
5069
tags.Author: "ReactiveOps"
5170
tags.Managed By: "Terraform"
@@ -59,6 +78,9 @@ Terraform will perform the following actions:
5978
private_ip: <computed>
6079
public_ip: <computed>
6180
subnet_id: "${element(aws_subnet.public.*.id, count.index)}"
81+
tags.%: "2"
82+
tags.Author: "ReactiveOps"
83+
tags.Managed By: "Terraform"
6284

6385
 + aws_nat_gateway.nat_gateway[1]
6486
 id: <computed>
@@ -67,6 +89,9 @@ Terraform will perform the following actions:
6789
private_ip: <computed>
6890
public_ip: <computed>
6991
subnet_id: "${element(aws_subnet.public.*.id, count.index)}"
92+
tags.%: "2"
93+
tags.Author: "ReactiveOps"
94+
tags.Managed By: "Terraform"
7095

7196
 + aws_nat_gateway.nat_gateway[2]
7297
 id: <computed>
@@ -75,6 +100,9 @@ Terraform will perform the following actions:
75100
private_ip: <computed>
76101
public_ip: <computed>
77102
subnet_id: "${element(aws_subnet.public.*.id, count.index)}"
103+
tags.%: "2"
104+
tags.Author: "ReactiveOps"
105+
tags.Managed By: "Terraform"
78106

79107
 + aws_route.private_nat_gateway[0]
80108
 id: <computed>
@@ -134,6 +162,7 @@ Terraform will perform the following actions:
134162

135163
 + aws_route_table.private[0]
136164
 id: <computed>
165+
owner_id: <computed>
137166
propagating_vgws.#: <computed>
138167
route.#: <computed>
139168
tags.%: "3"
@@ -144,6 +173,7 @@ Terraform will perform the following actions:
144173

145174
 + aws_route_table.private[1]
146175
 id: <computed>
176+
owner_id: <computed>
147177
propagating_vgws.#: <computed>
148178
route.#: <computed>
149179
tags.%: "3"
@@ -154,6 +184,7 @@ Terraform will perform the following actions:
154184

155185
 + aws_route_table.private[2]
156186
 id: <computed>
187+
owner_id: <computed>
157188
propagating_vgws.#: <computed>
158189
route.#: <computed>
159190
tags.%: "3"
@@ -164,6 +195,7 @@ Terraform will perform the following actions:
164195

165196
 + aws_route_table.public
166197
 id: <computed>
198+
owner_id: <computed>
167199
propagating_vgws.#: <computed>
168200
route.#: <computed>
169201
tags.%: "3"
@@ -237,10 +269,12 @@ Terraform will perform the following actions:
237269
arn: <computed>
238270
assign_ipv6_address_on_creation: "false"
239271
availability_zone: "us-east-1a"
272+
availability_zone_id: <computed>
240273
cidr_block: "10.21.0.0/21"
241274
ipv6_cidr_block: <computed>
242275
ipv6_cidr_block_association_id: <computed>
243276
map_public_ip_on_launch: "false"
277+
owner_id: <computed>
244278
tags.%: "3"
245279
tags.Author: "ReactiveOps"
246280
tags.Managed By: "Terraform"
@@ -252,10 +286,12 @@ Terraform will perform the following actions:
252286
arn: <computed>
253287
assign_ipv6_address_on_creation: "false"
254288
availability_zone: "us-east-1d"
289+
availability_zone_id: <computed>
255290
cidr_block: "10.21.8.0/21"
256291
ipv6_cidr_block: <computed>
257292
ipv6_cidr_block_association_id: <computed>
258293
map_public_ip_on_launch: "false"
294+
owner_id: <computed>
259295
tags.%: "3"
260296
tags.Author: "ReactiveOps"
261297
tags.Managed By: "Terraform"
@@ -267,10 +303,12 @@ Terraform will perform the following actions:
267303
arn: <computed>
268304
assign_ipv6_address_on_creation: "false"
269305
availability_zone: "us-east-1c"
306+
availability_zone_id: <computed>
270307
cidr_block: "10.21.16.0/21"
271308
ipv6_cidr_block: <computed>
272309
ipv6_cidr_block_association_id: <computed>
273310
map_public_ip_on_launch: "false"
311+
owner_id: <computed>
274312
tags.%: "3"
275313
tags.Author: "ReactiveOps"
276314
tags.Managed By: "Terraform"
@@ -282,10 +320,12 @@ Terraform will perform the following actions:
282320
arn: <computed>
283321
assign_ipv6_address_on_creation: "false"
284322
availability_zone: "us-east-1a"
323+
availability_zone_id: <computed>
285324
cidr_block: "10.21.64.0/21"
286325
ipv6_cidr_block: <computed>
287326
ipv6_cidr_block_association_id: <computed>
288327
map_public_ip_on_launch: "false"
328+
owner_id: <computed>
289329
tags.%: "3"
290330
tags.Author: "ReactiveOps"
291331
tags.Managed By: "Terraform"
@@ -297,10 +337,12 @@ Terraform will perform the following actions:
297337
arn: <computed>
298338
assign_ipv6_address_on_creation: "false"
299339
availability_zone: "us-east-1d"
340+
availability_zone_id: <computed>
300341
cidr_block: "10.21.72.0/21"
301342
ipv6_cidr_block: <computed>
302343
ipv6_cidr_block_association_id: <computed>
303344
map_public_ip_on_launch: "false"
345+
owner_id: <computed>
304346
tags.%: "3"
305347
tags.Author: "ReactiveOps"
306348
tags.Managed By: "Terraform"
@@ -312,10 +354,12 @@ Terraform will perform the following actions:
312354
arn: <computed>
313355
assign_ipv6_address_on_creation: "false"
314356
availability_zone: "us-east-1c"
357+
availability_zone_id: <computed>
315358
cidr_block: "10.21.80.0/21"
316359
ipv6_cidr_block: <computed>
317360
ipv6_cidr_block_association_id: <computed>
318361
map_public_ip_on_launch: "false"
362+
owner_id: <computed>
319363
tags.%: "3"
320364
tags.Author: "ReactiveOps"
321365
tags.Managed By: "Terraform"
@@ -327,10 +371,12 @@ Terraform will perform the following actions:
327371
arn: <computed>
328372
assign_ipv6_address_on_creation: "false"
329373
availability_zone: "us-east-1a"
374+
availability_zone_id: <computed>
330375
cidr_block: "10.21.96.0/21"
331376
ipv6_cidr_block: <computed>
332377
ipv6_cidr_block_association_id: <computed>
333378
map_public_ip_on_launch: "false"
379+
owner_id: <computed>
334380
tags.%: "3"
335381
tags.Author: "ReactiveOps"
336382
tags.Managed By: "Terraform"
@@ -342,10 +388,12 @@ Terraform will perform the following actions:
342388
arn: <computed>
343389
assign_ipv6_address_on_creation: "false"
344390
availability_zone: "us-east-1d"
391+
availability_zone_id: <computed>
345392
cidr_block: "10.21.104.0/21"
346393
ipv6_cidr_block: <computed>
347394
ipv6_cidr_block_association_id: <computed>
348395
map_public_ip_on_launch: "false"
396+
owner_id: <computed>
349397
tags.%: "3"
350398
tags.Author: "ReactiveOps"
351399
tags.Managed By: "Terraform"
@@ -357,10 +405,12 @@ Terraform will perform the following actions:
357405
arn: <computed>
358406
assign_ipv6_address_on_creation: "false"
359407
availability_zone: "us-east-1c"
408+
availability_zone_id: <computed>
360409
cidr_block: "10.21.112.0/21"
361410
ipv6_cidr_block: <computed>
362411
ipv6_cidr_block_association_id: <computed>
363412
map_public_ip_on_launch: "false"
413+
owner_id: <computed>
364414
tags.%: "3"
365415
tags.Author: "ReactiveOps"
366416
tags.Managed By: "Terraform"
@@ -372,10 +422,12 @@ Terraform will perform the following actions:
372422
arn: <computed>
373423
assign_ipv6_address_on_creation: "false"
374424
availability_zone: "us-east-1a"
425+
availability_zone_id: <computed>
375426
cidr_block: "10.21.32.0/21"
376427
ipv6_cidr_block: <computed>
377428
ipv6_cidr_block_association_id: <computed>
378429
map_public_ip_on_launch: "false"
430+
owner_id: <computed>
379431
tags.%: "3"
380432
tags.Author: "ReactiveOps"
381433
tags.Managed By: "Terraform"
@@ -387,10 +439,12 @@ Terraform will perform the following actions:
387439
arn: <computed>
388440
assign_ipv6_address_on_creation: "false"
389441
availability_zone: "us-east-1d"
442+
availability_zone_id: <computed>
390443
cidr_block: "10.21.40.0/21"
391444
ipv6_cidr_block: <computed>
392445
ipv6_cidr_block_association_id: <computed>
393446
map_public_ip_on_launch: "false"
447+
owner_id: <computed>
394448
tags.%: "3"
395449
tags.Author: "ReactiveOps"
396450
tags.Managed By: "Terraform"
@@ -402,10 +456,12 @@ Terraform will perform the following actions:
402456
arn: <computed>
403457
assign_ipv6_address_on_creation: "false"
404458
availability_zone: "us-east-1c"
459+
availability_zone_id: <computed>
405460
cidr_block: "10.21.48.0/21"
406461
ipv6_cidr_block: <computed>
407462
ipv6_cidr_block_association_id: <computed>
408463
map_public_ip_on_launch: "false"
464+
owner_id: <computed>
409465
tags.%: "3"
410466
tags.Author: "ReactiveOps"
411467
tags.Managed By: "Terraform"
@@ -429,6 +485,7 @@ Terraform will perform the following actions:
429485
ipv6_association_id: <computed>
430486
ipv6_cidr_block: <computed>
431487
main_route_table_id: <computed>
488+
owner_id: <computed>
432489
tags.%: "3"
433490
tags.Author: "ReactiveOps"
434491
tags.Managed By: "Terraform"

0 commit comments

Comments
 (0)