Skip to content

Commit ec5a0d2

Browse files
authored
feat: add arn outputs for: igw, cgw, vgw, default vpc, acls (#471)
1 parent bbf935e commit ec5a0d2

File tree

5 files changed

+82
-4
lines changed

5 files changed

+82
-4
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Sponsored by [Cloudcraft - the best way to draw AWS diagrams](https://cloudcraft
4141

4242
## Terraform versions
4343

44-
Terraform 0.12. Pin module version to `~> v2.0`. Submit pull-requests to `master` branch.
44+
Terraform 0.12 and newer. Pin module version to `~> v2.0`. Submit pull-requests to `master` branch.
4545

4646
Terraform 0.11. Pin module version to `~> v1.0`. Submit pull-requests to `terraform011` branch.
4747

@@ -225,13 +225,13 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
225225
| Name | Version |
226226
|------|---------|
227227
| terraform | >= 0.12.7, < 0.14 |
228-
| aws | >= 2.57, < 4.0 |
228+
| aws | >= 2.68, < 4.0 |
229229

230230
## Providers
231231

232232
| Name | Version |
233233
|------|---------|
234-
| aws | >= 2.57, < 4.0 |
234+
| aws | >= 2.68, < 4.0 |
235235

236236
## Inputs
237237

@@ -618,10 +618,12 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
618618
| Name | Description |
619619
|------|-------------|
620620
| azs | A list of availability zones specified as argument to this module |
621+
| cgw\_arns | List of ARNs of Customer Gateway |
621622
| cgw\_ids | List of IDs of Customer Gateway |
622623
| database\_internet\_gateway\_route\_id | ID of the database internet gateway route. |
623624
| database\_ipv6\_egress\_route\_id | ID of the database IPv6 egress route. |
624625
| database\_nat\_gateway\_route\_ids | List of IDs of the database nat gateway route. |
626+
| database\_network\_acl\_arn | ARN of the database network ACL |
625627
| database\_network\_acl\_id | ID of the database network ACL |
626628
| database\_route\_table\_association\_ids | List of IDs of the database route table association |
627629
| database\_route\_table\_ids | List of IDs of database route tables |
@@ -633,6 +635,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
633635
| default\_network\_acl\_id | The ID of the default network ACL |
634636
| default\_route\_table\_id | The ID of the default route table |
635637
| default\_security\_group\_id | The ID of the security group created by default on VPC creation |
638+
| default\_vpc\_arn | The ARN of the VPC |
636639
| default\_vpc\_cidr\_block | The CIDR block of the VPC |
637640
| default\_vpc\_default\_network\_acl\_id | The ID of the default network ACL |
638641
| default\_vpc\_default\_route\_table\_id | The ID of the default route table |
@@ -643,6 +646,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
643646
| default\_vpc\_instance\_tenancy | Tenancy of instances spin up within VPC |
644647
| default\_vpc\_main\_route\_table\_id | The ID of the main route table associated with this VPC |
645648
| egress\_only\_internet\_gateway\_id | The ID of the egress only Internet Gateway |
649+
| elasticache\_network\_acl\_arn | ARN of the elasticache network ACL |
646650
| elasticache\_network\_acl\_id | ID of the elasticache network ACL |
647651
| elasticache\_route\_table\_association\_ids | List of IDs of the elasticache route table association |
648652
| elasticache\_route\_table\_ids | List of IDs of elasticache route tables |
@@ -652,7 +656,9 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
652656
| elasticache\_subnets | List of IDs of elasticache subnets |
653657
| elasticache\_subnets\_cidr\_blocks | List of cidr\_blocks of elasticache subnets |
654658
| elasticache\_subnets\_ipv6\_cidr\_blocks | List of IPv6 cidr\_blocks of elasticache subnets in an IPv6 enabled VPC |
659+
| igw\_arn | The ARN of the Internet Gateway |
655660
| igw\_id | The ID of the Internet Gateway |
661+
| intra\_network\_acl\_arn | ARN of the intra network ACL |
656662
| intra\_network\_acl\_id | ID of the intra network ACL |
657663
| intra\_route\_table\_association\_ids | List of IDs of the intra route table association |
658664
| intra\_route\_table\_ids | List of IDs of intra route tables |
@@ -666,6 +672,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
666672
| natgw\_ids | List of NAT Gateway IDs |
667673
| private\_ipv6\_egress\_route\_ids | List of IDs of the ipv6 egress route. |
668674
| private\_nat\_gateway\_route\_ids | List of IDs of the private nat gateway route. |
675+
| private\_network\_acl\_arn | ARN of the private network ACL |
669676
| private\_network\_acl\_id | ID of the private network ACL |
670677
| private\_route\_table\_association\_ids | List of IDs of the private route table association |
671678
| private\_route\_table\_ids | List of IDs of private route tables |
@@ -675,13 +682,15 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
675682
| private\_subnets\_ipv6\_cidr\_blocks | List of IPv6 cidr\_blocks of private subnets in an IPv6 enabled VPC |
676683
| public\_internet\_gateway\_ipv6\_route\_id | ID of the IPv6 internet gateway route. |
677684
| public\_internet\_gateway\_route\_id | ID of the internet gateway route. |
685+
| public\_network\_acl\_arn | ARN of the public network ACL |
678686
| public\_network\_acl\_id | ID of the public network ACL |
679687
| public\_route\_table\_association\_ids | List of IDs of the public route table association |
680688
| public\_route\_table\_ids | List of IDs of public route tables |
681689
| public\_subnet\_arns | List of ARNs of public subnets |
682690
| public\_subnets | List of IDs of public subnets |
683691
| public\_subnets\_cidr\_blocks | List of cidr\_blocks of public subnets |
684692
| public\_subnets\_ipv6\_cidr\_blocks | List of IPv6 cidr\_blocks of public subnets in an IPv6 enabled VPC |
693+
| redshift\_network\_acl\_arn | ARN of the redshift network ACL |
685694
| redshift\_network\_acl\_id | ID of the redshift network ACL |
686695
| redshift\_public\_route\_table\_association\_ids | List of IDs of the public redshidt route table association |
687696
| redshift\_route\_table\_association\_ids | List of IDs of the redshift route table association |
@@ -692,6 +701,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway
692701
| redshift\_subnets\_cidr\_blocks | List of cidr\_blocks of redshift subnets |
693702
| redshift\_subnets\_ipv6\_cidr\_blocks | List of IPv6 cidr\_blocks of redshift subnets in an IPv6 enabled VPC |
694703
| this\_customer\_gateway | Map of Customer Gateway attributes |
704+
| vgw\_arn | The ARN of the VPN Gateway |
695705
| vgw\_id | The ID of the VPN Gateway |
696706
| vpc\_arn | The ARN of the VPC |
697707
| vpc\_cidr\_block | The CIDR block of the VPC |

examples/network-acls/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ No input.
3636
| Name | Description |
3737
|------|-------------|
3838
| default\_network\_acl\_id | The ID of the default network ACL |
39+
| elasticache\_network\_acl\_arn | ARN of the elasticache network ACL |
3940
| elasticache\_network\_acl\_id | ID of the elasticache network ACL |
4041
| module\_vpc | Module VPC |
4142
| nat\_public\_ips | List of public Elastic IPs created for AWS NAT Gateway |
43+
| private\_network\_acl\_arn | ARN of the private network ACL |
4244
| private\_network\_acl\_id | ID of the private network ACL |
4345
| private\_subnets | List of IDs of private subnets |
46+
| public\_network\_acl\_arn | ARN of the public network ACL |
4447
| public\_network\_acl\_id | ID of the public network ACL |
4548
| public\_subnets | List of IDs of public subnets |
4649
| vpc\_cidr\_block | The CIDR block of the VPC |

examples/network-acls/outputs.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ output "default_network_acl_id" {
5353
value = module.vpc.default_network_acl_id
5454
}
5555

56+
output "public_network_acl_arn" {
57+
description = "ARN of the public network ACL"
58+
value = module.vpc.public_network_acl_arn
59+
}
60+
61+
output "private_network_acl_arn" {
62+
description = "ARN of the private network ACL"
63+
value = module.vpc.private_network_acl_arn
64+
}
65+
66+
output "elasticache_network_acl_arn" {
67+
description = "ARN of the elasticache network ACL"
68+
value = module.vpc.elasticache_network_acl_arn
69+
}
70+
5671
output "module_vpc" {
5772
description = "Module VPC"
5873
value = module.vpc

outputs.tf

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ output "igw_id" {
333333
value = concat(aws_internet_gateway.this.*.id, [""])[0]
334334
}
335335

336+
output "igw_arn" {
337+
description = "The ARN of the Internet Gateway"
338+
value = concat(aws_internet_gateway.this.*.arn, [""])[0]
339+
}
340+
336341
output "egress_only_internet_gateway_id" {
337342
description = "The ID of the egress only Internet Gateway"
338343
value = concat(aws_egress_only_internet_gateway.this.*.id, [""])[0]
@@ -343,6 +348,11 @@ output "cgw_ids" {
343348
value = [for k, v in aws_customer_gateway.this : v.id]
344349
}
345350

351+
output "cgw_arns" {
352+
description = "List of ARNs of Customer Gateway"
353+
value = [for k, v in aws_customer_gateway.this : v.arn]
354+
}
355+
346356
output "this_customer_gateway" {
347357
description = "Map of Customer Gateway attributes"
348358
value = aws_customer_gateway.this
@@ -357,11 +367,21 @@ output "vgw_id" {
357367
)[0]
358368
}
359369

370+
output "vgw_arn" {
371+
description = "The ARN of the VPN Gateway"
372+
value = concat(aws_vpn_gateway.this.*.arn, [""])[0]
373+
}
374+
360375
output "default_vpc_id" {
361376
description = "The ID of the VPC"
362377
value = concat(aws_default_vpc.this.*.id, [""])[0]
363378
}
364379

380+
output "default_vpc_arn" {
381+
description = "The ARN of the VPC"
382+
value = concat(aws_default_vpc.this.*.arn, [""])[0]
383+
}
384+
365385
output "default_vpc_cidr_block" {
366386
description = "The CIDR block of the VPC"
367387
value = concat(aws_default_vpc.this.*.cidr_block, [""])[0]
@@ -422,31 +442,61 @@ output "public_network_acl_id" {
422442
value = concat(aws_network_acl.public.*.id, [""])[0]
423443
}
424444

445+
output "public_network_acl_arn" {
446+
description = "ARN of the public network ACL"
447+
value = concat(aws_network_acl.public.*.arn, [""])[0]
448+
}
449+
425450
output "private_network_acl_id" {
426451
description = "ID of the private network ACL"
427452
value = concat(aws_network_acl.private.*.id, [""])[0]
428453
}
429454

455+
output "private_network_acl_arn" {
456+
description = "ARN of the private network ACL"
457+
value = concat(aws_network_acl.private.*.arn, [""])[0]
458+
}
459+
430460
output "intra_network_acl_id" {
431461
description = "ID of the intra network ACL"
432462
value = concat(aws_network_acl.intra.*.id, [""])[0]
433463
}
434464

465+
output "intra_network_acl_arn" {
466+
description = "ARN of the intra network ACL"
467+
value = concat(aws_network_acl.intra.*.arn, [""])[0]
468+
}
469+
435470
output "database_network_acl_id" {
436471
description = "ID of the database network ACL"
437472
value = concat(aws_network_acl.database.*.id, [""])[0]
438473
}
439474

475+
output "database_network_acl_arn" {
476+
description = "ARN of the database network ACL"
477+
value = concat(aws_network_acl.database.*.arn, [""])[0]
478+
}
479+
440480
output "redshift_network_acl_id" {
441481
description = "ID of the redshift network ACL"
442482
value = concat(aws_network_acl.redshift.*.id, [""])[0]
443483
}
444484

485+
output "redshift_network_acl_arn" {
486+
description = "ARN of the redshift network ACL"
487+
value = concat(aws_network_acl.redshift.*.arn, [""])[0]
488+
}
489+
445490
output "elasticache_network_acl_id" {
446491
description = "ID of the elasticache network ACL"
447492
value = concat(aws_network_acl.elasticache.*.id, [""])[0]
448493
}
449494

495+
output "elasticache_network_acl_arn" {
496+
description = "ARN of the elasticache network ACL"
497+
value = concat(aws_network_acl.elasticache.*.arn, [""])[0]
498+
}
499+
450500
# VPC Endpoints
451501
output "vpc_endpoint_s3_id" {
452502
description = "The ID of VPC endpoint for S3"

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ terraform {
22
required_version = ">= 0.12.7, < 0.14"
33

44
required_providers {
5-
aws = ">= 2.57, < 4.0"
5+
aws = ">= 2.68, < 4.0"
66
}
77
}

0 commit comments

Comments
 (0)