From 7764737bf7de238ce82856b1092cb57525884bb7 Mon Sep 17 00:00:00 2001 From: Matt Calhoun Date: Wed, 2 Jun 2021 11:39:14 -0400 Subject: [PATCH] add elb account lookup (#11) Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com> --- README.md | 3 ++- docs/terraform.md | 3 ++- outputs.tf | 17 ++++++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6102eca..9099cf5 100644 --- a/README.md +++ b/README.md @@ -211,8 +211,9 @@ Available targets: | Name | Description | |------|-------------| | [disabled\_regions](#output\_disabled\_regions) | A list of regions that are disabled in the account | +| [elb\_logging\_account](#output\_elb\_logging\_account) | Map of full region to ELB logging account | | [enabled\_regions](#output\_enabled\_regions) | A list of regions that are enabled in the account | -| [region\_az\_alt\_code\_maps](#output\_region\_az\_alt\_code\_maps) | Collection of maps converting between official AWS Region, Availability Zone, and Local Zone codes and shorter unofficial codes using only lower case letters and digits. Inspired for use in naming and tagging so that region or AZ code will be 1 semantic unit.

- `to_fixed` = Map of regions to 3-character codes and Availability Zones to 4-character codes
- `to_short` = Map of regions and Availability Zones to compact (usually 4-6 characters) codes
- `from_fixed` = Map of `fixed` codes back to full region or Availability Zone codes
- `from_short` = Map of `short` codes back to full region or Availability Zone codes
- `identity` = Identity map of full region and Availability Zone codes back to themselves
- `elb_logging_account` = Map of full region to ELB logging account | +| [region\_az\_alt\_code\_maps](#output\_region\_az\_alt\_code\_maps) | Collection of maps converting between official AWS Region, Availability Zone, and Local Zone codes and shorter unofficial codes using only lower case letters and digits. Inspired for use in naming and tagging so that region or AZ code will be 1 semantic unit.

- `to_fixed` = Map of regions to 3-character codes and Availability Zones to 4-character codes
- `to_short` = Map of regions and Availability Zones to compact (usually 4-6 characters) codes
- `from_fixed` = Map of `fixed` codes back to full region or Availability Zone codes
- `from_short` = Map of `short` codes back to full region or Availability Zone codes
- `identity` = Identity map of full region and Availability Zone codes back to themselves | diff --git a/docs/terraform.md b/docs/terraform.md index 85e036e..4cbf847 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -52,6 +52,7 @@ | Name | Description | |------|-------------| | [disabled\_regions](#output\_disabled\_regions) | A list of regions that are disabled in the account | +| [elb\_logging\_account](#output\_elb\_logging\_account) | Map of full region to ELB logging account | | [enabled\_regions](#output\_enabled\_regions) | A list of regions that are enabled in the account | -| [region\_az\_alt\_code\_maps](#output\_region\_az\_alt\_code\_maps) | Collection of maps converting between official AWS Region, Availability Zone, and Local Zone codes and shorter unofficial codes using only lower case letters and digits. Inspired for use in naming and tagging so that region or AZ code will be 1 semantic unit.

- `to_fixed` = Map of regions to 3-character codes and Availability Zones to 4-character codes
- `to_short` = Map of regions and Availability Zones to compact (usually 4-6 characters) codes
- `from_fixed` = Map of `fixed` codes back to full region or Availability Zone codes
- `from_short` = Map of `short` codes back to full region or Availability Zone codes
- `identity` = Identity map of full region and Availability Zone codes back to themselves
- `elb_logging_account` = Map of full region to ELB logging account | +| [region\_az\_alt\_code\_maps](#output\_region\_az\_alt\_code\_maps) | Collection of maps converting between official AWS Region, Availability Zone, and Local Zone codes and shorter unofficial codes using only lower case letters and digits. Inspired for use in naming and tagging so that region or AZ code will be 1 semantic unit.

- `to_fixed` = Map of regions to 3-character codes and Availability Zones to 4-character codes
- `to_short` = Map of regions and Availability Zones to compact (usually 4-6 characters) codes
- `from_fixed` = Map of `fixed` codes back to full region or Availability Zone codes
- `from_short` = Map of `short` codes back to full region or Availability Zone codes
- `identity` = Identity map of full region and Availability Zone codes back to themselves | diff --git a/outputs.tf b/outputs.tf index 609360e..9086a8b 100644 --- a/outputs.tf +++ b/outputs.tf @@ -7,18 +7,21 @@ output "region_az_alt_code_maps" { - `from_fixed` = Map of `fixed` codes back to full region or Availability Zone codes - `from_short` = Map of `short` codes back to full region or Availability Zone codes - `identity` = Identity map of full region and Availability Zone codes back to themselves - - `elb_logging_account` = Map of full region to ELB logging account EOT value = { - to_fixed = local.to_fixed - to_short = local.to_short - from_fixed = local.from_fixed - from_short = local.from_short - identity = local.identity - elb_logging_account = local.elb_logging_account + to_fixed = local.to_fixed + to_short = local.to_short + from_fixed = local.from_fixed + from_short = local.from_short + identity = local.identity } } +output "elb_logging_account" { + description = "Map of full region to ELB logging account" + value = local.elb_logging_account +} + output "enabled_regions" { description = "A list of regions that are enabled in the account" value = setunion(data.aws_regions.default.names, data.aws_regions.opted_in.names)