From 507822a2703d3fb6f9d35448c216116322d01ee1 Mon Sep 17 00:00:00 2001 From: DrFaust92 Date: Sat, 25 Jul 2020 22:53:08 +0300 Subject: [PATCH 1/7] add arns for: igw, cgw, vgw, default vpc, acls --- README.md | 14 ++++++++++++-- outputs.tf | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ versions.tf | 2 +- 3 files changed, 66 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 857f66f30..b4373b984 100644 --- a/README.md +++ b/README.md @@ -225,13 +225,13 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway | Name | Version | |------|---------| | terraform | >= 0.12.6, < 0.14 | -| aws | ~> 2.57 | +| aws | ~> 2.68 | ## Providers | Name | Version | |------|---------| -| aws | ~> 2.57 | +| aws | ~> 2.68 | ## Inputs @@ -618,10 +618,12 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway | Name | Description | |------|-------------| | azs | A list of availability zones specified as argument to this module | +| cgw\_arns | List of ARNs of Customer Gateway | | cgw\_ids | List of IDs of Customer Gateway | | database\_internet\_gateway\_route\_id | ID of the database internet gateway route. | | database\_ipv6\_egress\_route\_id | ID of the database IPv6 egress route. | | database\_nat\_gateway\_route\_ids | List of IDs of the database nat gateway route. | +| database\_network\_acl\_arn | ARN of the database network ACL | | database\_network\_acl\_id | ID of the database network ACL | | database\_route\_table\_association\_ids | List of IDs of the database route table association | | 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 | default\_network\_acl\_id | The ID of the default network ACL | | default\_route\_table\_id | The ID of the default route table | | default\_security\_group\_id | The ID of the security group created by default on VPC creation | +| default\_vpc\_arn | The ARN of the VPC | | default\_vpc\_cidr\_block | The CIDR block of the VPC | | default\_vpc\_default\_network\_acl\_id | The ID of the default network ACL | | 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 | default\_vpc\_instance\_tenancy | Tenancy of instances spin up within VPC | | default\_vpc\_main\_route\_table\_id | The ID of the main route table associated with this VPC | | egress\_only\_internet\_gateway\_id | The ID of the egress only Internet Gateway | +| elasticache\_network\_acl\_arn | ARN of the elasticache network ACL | | elasticache\_network\_acl\_id | ID of the elasticache network ACL | | elasticache\_route\_table\_association\_ids | List of IDs of the elasticache route table association | | 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 | elasticache\_subnets | List of IDs of elasticache subnets | | elasticache\_subnets\_cidr\_blocks | List of cidr\_blocks of elasticache subnets | | elasticache\_subnets\_ipv6\_cidr\_blocks | List of IPv6 cidr\_blocks of elasticache subnets in an IPv6 enabled VPC | +| igw\_arn | The ARN of the Internet Gateway | | igw\_id | The ID of the Internet Gateway | +| intra\_network\_acl\_arn | ARN of the intra network ACL | | intra\_network\_acl\_id | ID of the intra network ACL | | intra\_route\_table\_association\_ids | List of IDs of the intra route table association | | 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 | natgw\_ids | List of NAT Gateway IDs | | private\_ipv6\_egress\_route\_ids | List of IDs of the ipv6 egress route. | | private\_nat\_gateway\_route\_ids | List of IDs of the private nat gateway route. | +| private\_network\_acl\_arn | ARN of the private network ACL | | private\_network\_acl\_id | ID of the private network ACL | | private\_route\_table\_association\_ids | List of IDs of the private route table association | | private\_route\_table\_ids | List of IDs of private route tables | @@ -675,6 +682,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway | private\_subnets\_ipv6\_cidr\_blocks | List of IPv6 cidr\_blocks of private subnets in an IPv6 enabled VPC | | public\_internet\_gateway\_ipv6\_route\_id | ID of the IPv6 internet gateway route. | | public\_internet\_gateway\_route\_id | ID of the internet gateway route. | +| public\_network\_acl\_arn | ARN of the public network ACL | | public\_network\_acl\_id | ID of the public network ACL | | public\_route\_table\_association\_ids | List of IDs of the public route table association | | public\_route\_table\_ids | List of IDs of public route tables | @@ -682,6 +690,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway | public\_subnets | List of IDs of public subnets | | public\_subnets\_cidr\_blocks | List of cidr\_blocks of public subnets | | public\_subnets\_ipv6\_cidr\_blocks | List of IPv6 cidr\_blocks of public subnets in an IPv6 enabled VPC | +| redshift\_network\_acl\_arn | ARN of the redshift network ACL | | redshift\_network\_acl\_id | ID of the redshift network ACL | | redshift\_public\_route\_table\_association\_ids | List of IDs of the public redshidt route table association | | 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 | redshift\_subnets\_cidr\_blocks | List of cidr\_blocks of redshift subnets | | redshift\_subnets\_ipv6\_cidr\_blocks | List of IPv6 cidr\_blocks of redshift subnets in an IPv6 enabled VPC | | this\_customer\_gateway | Map of Customer Gateway attributes | +| vgw\_arn | The ARN of the VPN Gateway | | vgw\_id | The ID of the VPN Gateway | | vpc\_arn | The ARN of the VPC | | vpc\_cidr\_block | The CIDR block of the VPC | diff --git a/outputs.tf b/outputs.tf index 353c31a37..a7e07eb4d 100644 --- a/outputs.tf +++ b/outputs.tf @@ -333,6 +333,11 @@ output "igw_id" { value = concat(aws_internet_gateway.this.*.id, [""])[0] } +output "igw_arn" { + description = "The ARN of the Internet Gateway" + value = concat(aws_internet_gateway.this.*.arn, [""])[0] +} + output "egress_only_internet_gateway_id" { description = "The ID of the egress only Internet Gateway" value = concat(aws_egress_only_internet_gateway.this.*.id, [""])[0] @@ -343,6 +348,11 @@ output "cgw_ids" { value = [for k, v in aws_customer_gateway.this : v.id] } +output "cgw_arns" { + description = "List of ARNs of Customer Gateway" + value = [for k, v in aws_customer_gateway.this : v.arn] +} + output "this_customer_gateway" { description = "Map of Customer Gateway attributes" value = aws_customer_gateway.this @@ -357,11 +367,24 @@ output "vgw_id" { )[0] } +output "vgw_arn" { + description = "The ARN of the VPN Gateway" + value = concat( + aws_vpn_gateway.this.*.arn, + [""], + )[0] +} + output "default_vpc_id" { description = "The ID of the VPC" value = concat(aws_default_vpc.this.*.id, [""])[0] } +output "default_vpc_arn" { + description = "The ARN of the VPC" + value = concat(aws_default_vpc.this.*.arn, [""])[0] +} + output "default_vpc_cidr_block" { description = "The CIDR block of the VPC" value = concat(aws_default_vpc.this.*.cidr_block, [""])[0] @@ -422,31 +445,61 @@ output "public_network_acl_id" { value = concat(aws_network_acl.public.*.id, [""])[0] } +output "public_network_acl_arn" { + description = "ARN of the public network ACL" + value = concat(aws_network_acl.public.*.arn, [""])[0] +} + output "private_network_acl_id" { description = "ID of the private network ACL" value = concat(aws_network_acl.private.*.id, [""])[0] } +output "private_network_acl_arn" { + description = "ARN of the private network ACL" + value = concat(aws_network_acl.private.*.arn, [""])[0] +} + output "intra_network_acl_id" { description = "ID of the intra network ACL" value = concat(aws_network_acl.intra.*.id, [""])[0] } +output "intra_network_acl_arn" { + description = "ARN of the intra network ACL" + value = concat(aws_network_acl.intra.*.arn, [""])[0] +} + output "database_network_acl_id" { description = "ID of the database network ACL" value = concat(aws_network_acl.database.*.id, [""])[0] } +output "database_network_acl_arn" { + description = "ARN of the database network ACL" + value = concat(aws_network_acl.database.*.arn, [""])[0] +} + output "redshift_network_acl_id" { description = "ID of the redshift network ACL" value = concat(aws_network_acl.redshift.*.id, [""])[0] } +output "redshift_network_acl_arn" { + description = "ARN of the redshift network ACL" + value = concat(aws_network_acl.redshift.*.arn, [""])[0] +} + output "elasticache_network_acl_id" { description = "ID of the elasticache network ACL" value = concat(aws_network_acl.elasticache.*.id, [""])[0] } +output "elasticache_network_acl_arn" { + description = "ARN of the elasticache network ACL" + value = concat(aws_network_acl.elasticache.*.arn, [""])[0] +} + # VPC Endpoints output "vpc_endpoint_s3_id" { description = "The ID of VPC endpoint for S3" diff --git a/versions.tf b/versions.tf index 0d628ebcf..409297b5c 100644 --- a/versions.tf +++ b/versions.tf @@ -2,6 +2,6 @@ terraform { required_version = ">= 0.12.6, < 0.14" required_providers { - aws = "~> 2.57" + aws = "~> 2.68" } } From 4d43c6206c43ddd2afef36d444e85ca42cd6c784 Mon Sep 17 00:00:00 2001 From: DrFaust92 Date: Sat, 25 Jul 2020 23:23:49 +0300 Subject: [PATCH 2/7] add to example --- examples/network-acls/outputs.tf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/network-acls/outputs.tf b/examples/network-acls/outputs.tf index 3dc75f4f4..8bf1d7f48 100644 --- a/examples/network-acls/outputs.tf +++ b/examples/network-acls/outputs.tf @@ -53,6 +53,21 @@ output "default_network_acl_id" { value = module.vpc.default_network_acl_id } +output "public_network_acl_arn" { + description = "ARN of the public network ACL" + value = module.vpc.public_network_acl_arn +} + +output "private_network_acl_arn" { + description = "ARN of the private network ACL" + value = module.vpc.private_network_acl_arn +} + +output "elasticache_network_acl_arn" { + description = "ARN of the elasticache network ACL" + value = module.vpc.elasticache_network_acl_arn +} + output "module_vpc" { description = "Module VPC" value = module.vpc From 065c500132786cc9fe7e4e03f32c5aec94069d2f Mon Sep 17 00:00:00 2001 From: DrFaust92 Date: Sat, 25 Jul 2020 23:27:28 +0300 Subject: [PATCH 3/7] fix output --- outputs.tf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/outputs.tf b/outputs.tf index a7e07eb4d..ea5614817 100644 --- a/outputs.tf +++ b/outputs.tf @@ -369,10 +369,7 @@ output "vgw_id" { output "vgw_arn" { description = "The ARN of the VPN Gateway" - value = concat( - aws_vpn_gateway.this.*.arn, - [""], - )[0] + value = concat(aws_vpn_gateway.this.*.arn, [""])[0] } output "default_vpc_id" { From 75698dec0d8e1693a69e2727e299fe5e4b8b4685 Mon Sep 17 00:00:00 2001 From: DrFaust92 Date: Sat, 25 Jul 2020 23:36:16 +0300 Subject: [PATCH 4/7] add output to example --- examples/network-acls/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/network-acls/README.md b/examples/network-acls/README.md index eee08e771..2252fac6e 100644 --- a/examples/network-acls/README.md +++ b/examples/network-acls/README.md @@ -36,11 +36,14 @@ No input. | Name | Description | |------|-------------| | default\_network\_acl\_id | The ID of the default network ACL | +| elasticache\_network\_acl\_arn | ARN of the elasticache network ACL | | elasticache\_network\_acl\_id | ID of the elasticache network ACL | | module\_vpc | Module VPC | | nat\_public\_ips | List of public Elastic IPs created for AWS NAT Gateway | +| private\_network\_acl\_arn | ARN of the private network ACL | | private\_network\_acl\_id | ID of the private network ACL | | private\_subnets | List of IDs of private subnets | +| public\_network\_acl\_arn | ARN of the public network ACL | | public\_network\_acl\_id | ID of the public network ACL | | public\_subnets | List of IDs of public subnets | | vpc\_cidr\_block | The CIDR block of the VPC | From 881b2944e726f44d40a80ed7cb3920f254f4a2d8 Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Thu, 13 Aug 2020 14:43:16 +0200 Subject: [PATCH 5/7] Fixed version range --- README.md | 4 ++-- versions.tf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b4373b984..40b768ed6 100644 --- a/README.md +++ b/README.md @@ -225,13 +225,13 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway | Name | Version | |------|---------| | terraform | >= 0.12.6, < 0.14 | -| aws | ~> 2.68 | +| aws | >= 2.68, < 4.0 | ## Providers | Name | Version | |------|---------| -| aws | ~> 2.68 | +| aws | >= 2.68, < 4.0 | ## Inputs diff --git a/versions.tf b/versions.tf index 409297b5c..8bd962296 100644 --- a/versions.tf +++ b/versions.tf @@ -2,6 +2,6 @@ terraform { required_version = ">= 0.12.6, < 0.14" required_providers { - aws = "~> 2.68" + aws = ">= 2.68, < 4.0" } } From 7cb51c408e5a95fc924a85c5c930668d48e244e5 Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Thu, 13 Aug 2020 14:43:49 +0200 Subject: [PATCH 6/7] Updated README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40b768ed6..19e4f6ea5 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Sponsored by [Cloudcraft - the best way to draw AWS diagrams](https://cloudcraft ## Terraform versions -Terraform 0.12. Pin module version to `~> v2.0`. Submit pull-requests to `master` branch. +Terraform 0.12 and newer. Pin module version to `~> v2.0`. Submit pull-requests to `master` branch. Terraform 0.11. Pin module version to `~> v1.0`. Submit pull-requests to `terraform011` branch. From 324d2285288f024aa039e3c0b0e959871278d93a Mon Sep 17 00:00:00 2001 From: Anton Babenko Date: Thu, 13 Aug 2020 14:44:59 +0200 Subject: [PATCH 7/7] Fixed version range --- README.md | 2 +- versions.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 19e4f6ea5..0cb7eed89 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ It is possible to integrate this VPC module with [terraform-aws-transit-gateway | Name | Version | |------|---------| -| terraform | >= 0.12.6, < 0.14 | +| terraform | >= 0.12.7, < 0.14 | | aws | >= 2.68, < 4.0 | ## Providers diff --git a/versions.tf b/versions.tf index 8bd962296..178df14b8 100644 --- a/versions.tf +++ b/versions.tf @@ -1,5 +1,5 @@ terraform { - required_version = ">= 0.12.6, < 0.14" + required_version = ">= 0.12.7, < 0.14" required_providers { aws = ">= 2.68, < 4.0"