-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from terraform-modules/upgrade-tf
update to az to use for_each
- Loading branch information
Showing
4 changed files
with
22 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,25 @@ | ||
| # locals { | ||
| # az_list = data.aws_availability_zones.zones.names | ||
| # az_count = length(local.az_list) | ||
| # az_count_list = range(local.az_count) | ||
| # } | ||
|
|
||
| data "aws_availability_zones" "zones" { | ||
| state = "available" | ||
| } | ||
|
|
||
| data "aws_availability_zone" "zone" { | ||
| count = length(data.aws_availability_zones.zones.names) | ||
| state = "available" | ||
| name = data.aws_availability_zones.zones.names[count.index] | ||
| for_each = toset(data.aws_availability_zones.zones.names) | ||
| state = "available" | ||
| name = each.key | ||
| } | ||
|
|
||
|
|
||
| output "availability_zone_names" { | ||
| description = "VPC Availability zone name list (3)" | ||
| description = "VPC Availability zone name list" | ||
| value = data.aws_availability_zones.zones.names | ||
| } | ||
|
|
||
| output "availability_zone_ids" { | ||
| description = "VPC Availability zone id list (3)" | ||
| description = "VPC Availability zone id list" | ||
| value = data.aws_availability_zones.zones.zone_ids | ||
| } | ||
|
|
||
| output "availability_zone_suffixes" { | ||
| description = "VPC Availability zone suffix list (3)" | ||
| value = data.aws_availability_zone.zone[*].name_suffix | ||
| description = "VPC Availability zone suffix list" | ||
| value = [for k, v in data.aws_availability_zone.zone : v.name_suffix] | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Examples | ||
|
|
||
| Create directories with specific examples and describe how to use the module in a variety of ways. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| terraform { | ||
| required_providers { | ||
| aws = { | ||
| source = "hashicorp/aws" | ||
| version = ">= 3.66.0" | ||
| } | ||
| } | ||
| required_version = ">= 0.13" | ||
| } |