Skip to content

Commit

Permalink
subnet: add arn to output
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Sep 13, 2022
1 parent a67c5ea commit b4df63a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion common/version.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
locals {
_module_version = "2.1.0"
_module_version = "2.1.1"
_module_names = {
"_main_" = "aws-vpc-setup"

Expand Down
9 changes: 5 additions & 4 deletions subnets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|------|-------------|------|---------|:--------:|
| <a name="input_account_alias"></a> [account\_alias](#input\_account\_alias) | AWS Account Alias | `string` | `""` | no |
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | AWS Account ID (default will pull from current user) | `string` | `""` | no |
| <a name="input_account_alias"></a> [account\_alias](#input\_account\_alias) | AWS Account Alias (default: will pull from current account\_alias) | `string` | `""` | no |
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | AWS Account ID (default: will pull from current user) | `string` | `""` | no |
| <a name="input_availability_zones"></a> [availability\_zones](#input\_availability\_zones) | AWS Availability Zones to use (by default will use all available) | `list(string)` | `[]` | no |
| <a name="input_override_prefixes"></a> [override\_prefixes](#input\_override\_prefixes) | Override built-in prefixes by component. This should be used primarily for common infrastructure things | `map(string)` | `{}` | no |
| <a name="input_private_subnets"></a> [private\_subnets](#input\_private\_subnets) | List of objects with private subnet information to be created | <pre>list(object({<br> base_cidr = string<br> label = string<br> bits = number<br> private = bool<br> tags = map(string)<br> # subnets = list(string)<br> # labels = list(string)<br> # availability_zones = list(string)<br> }))</pre> | `[]` | no |
Expand All @@ -106,5 +107,5 @@ No modules.
| <a name="output_availability_zone_ids"></a> [availability\_zone\_ids](#output\_availability\_zone\_ids) | VPC Availability zone id list (3) |
| <a name="output_availability_zone_names"></a> [availability\_zone\_names](#output\_availability\_zone\_names) | VPC Availability zone name list (3) |
| <a name="output_availability_zone_suffixes"></a> [availability\_zone\_suffixes](#output\_availability\_zone\_suffixes) | VPC Availability zone suffix list (3) |
| <a name="output_private_subnets_ids"></a> [private\_subnets\_ids](#output\_private\_subnets\_ids) | Resulting private subnets list of objects: subnet, label, availability\_zone, id |
| <a name="output_public_subnets_ids"></a> [public\_subnets\_ids](#output\_public\_subnets\_ids) | Resulting public subnets list of objects: subnet, label, availability\_zone, id |
| <a name="output_private_subnets_ids"></a> [private\_subnets\_ids](#output\_private\_subnets\_ids) | Resulting private subnets list of objects: subnet, label, availability\_zone, id, arn |
| <a name="output_public_subnets_ids"></a> [public\_subnets\_ids](#output\_public\_subnets\_ids) | Resulting public subnets list of objects: subnet, label, availability\_zone, id, arn |
14 changes: 10 additions & 4 deletions subnets/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit b4df63a

Please sign in to comment.