From b4df63a42a7ae533fdb79a50b8c1b161a816214e Mon Sep 17 00:00:00 2001 From: badra001 Date: Tue, 13 Sep 2022 15:25:13 -0400 Subject: [PATCH] subnet: add arn to output --- CHANGELOG.md | 15 +++++++++++++++ common/version.tf | 2 +- subnets/README.md | 9 +++++---- subnets/outputs.tf | 14 ++++++++++---- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c932231..8d9fb42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -130,6 +130,17 @@ - flowlogs - update template to use account-alias and vpc name +* 1.6.7 -- 2022-07-15 + - fix flowlogs filename + +* 1.6.8 -- 2022-08-09 + - vpn + - fix vpn gateway (backport from tf-upgrade) + +* 1.6.9 -- 2022-09-13 + - subnet + - add arn to output + ## Version 2.x * 2.0.0 -- 2022-05-09 @@ -163,3 +174,7 @@ - flowlogs-transit-gateway - setup for transit gateway - add enable_kinesis flag + +* 2.1.1 -- 2022-09-13 + - subnet + - add arn to output diff --git a/common/version.tf b/common/version.tf index a7c3c48..9e41897 100644 --- a/common/version.tf +++ b/common/version.tf @@ -1,5 +1,5 @@ locals { - _module_version = "2.1.0" + _module_version = "2.1.1" _module_names = { "_main_" = "aws-vpc-setup" diff --git a/subnets/README.md b/subnets/README.md index 679bd0a..3198692 100644 --- a/subnets/README.md +++ b/subnets/README.md @@ -79,14 +79,15 @@ No modules. | [aws_availability_zone.zone](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zone) | data source | | [aws_availability_zones.zones](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones) | data source | | [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source | +| [aws_iam_account_alias.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_account_alias) | data source | | [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source | ## Inputs | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [account\_alias](#input\_account\_alias) | AWS Account Alias | `string` | `""` | no | -| [account\_id](#input\_account\_id) | AWS Account ID (default will pull from current user) | `string` | `""` | no | +| [account\_alias](#input\_account\_alias) | AWS Account Alias (default: will pull from current account\_alias) | `string` | `""` | no | +| [account\_id](#input\_account\_id) | AWS Account ID (default: will pull from current user) | `string` | `""` | no | | [availability\_zones](#input\_availability\_zones) | AWS Availability Zones to use (by default will use all available) | `list(string)` | `[]` | no | | [override\_prefixes](#input\_override\_prefixes) | Override built-in prefixes by component. This should be used primarily for common infrastructure things | `map(string)` | `{}` | no | | [private\_subnets](#input\_private\_subnets) | List of objects with private subnet information to be created |
list(object({
base_cidr = string
label = string
bits = number
private = bool
tags = map(string)
# subnets = list(string)
# labels = list(string)
# availability_zones = list(string)
}))
| `[]` | no | @@ -106,5 +107,5 @@ No modules. | [availability\_zone\_ids](#output\_availability\_zone\_ids) | VPC Availability zone id list (3) | | [availability\_zone\_names](#output\_availability\_zone\_names) | VPC Availability zone name list (3) | | [availability\_zone\_suffixes](#output\_availability\_zone\_suffixes) | VPC Availability zone suffix list (3) | -| [private\_subnets\_ids](#output\_private\_subnets\_ids) | Resulting private subnets list of objects: subnet, label, availability\_zone, id | -| [public\_subnets\_ids](#output\_public\_subnets\_ids) | Resulting public subnets list of objects: subnet, label, availability\_zone, id | +| [private\_subnets\_ids](#output\_private\_subnets\_ids) | Resulting private subnets list of objects: subnet, label, availability\_zone, id, arn | +| [public\_subnets\_ids](#output\_public\_subnets\_ids) | Resulting public subnets list of objects: subnet, label, availability\_zone, id, arn | diff --git a/subnets/outputs.tf b/subnets/outputs.tf index e22e49c..6b5d5e4 100644 --- a/subnets/outputs.tf +++ b/subnets/outputs.tf @@ -2,23 +2,29 @@ locals { output_public_subnets = [for subnet in local.public_map : merge( subnet, - tomap({ "id" = aws_subnet.public[subnet.label].id }), + { + "id" = aws_subnet.public[subnet.label].id + "arn" = aws_subnet.public[subnet.label].arn + }, ) ] output_private_subnets = [for subnet in local.private_map : merge( subnet, - tomap({ "id" = aws_subnet.private[subnet.label].id }), + { + "id" = aws_subnet.private[subnet.label].id + "arn" = aws_subnet.private[subnet.label].arn + }, ) ] } output "public_subnets_ids" { - description = "Resulting public subnets list of objects: subnet, label, availability_zone, id" + description = "Resulting public subnets list of objects: subnet, label, availability_zone, id, arn" value = local.output_public_subnets } output "private_subnets_ids" { - description = "Resulting private subnets list of objects: subnet, label, availability_zone, id" + description = "Resulting private subnets list of objects: subnet, label, availability_zone, id, arn" value = local.output_private_subnets }