Created
February 7, 2022 12:29
-
-
Save FernandoMiguel/fdaaa3983491cbc31cb5c3ba3880bccd to your computer and use it in GitHub Desktop.
here’s how simple it is to avoid putting resources from the bad us-east1 AZ
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
data "aws_availability_zones" "good_zone_ids" { | |
exclude_zone_ids = [ | |
# There are no modern instance types in use1-az3; AWS has left | |
# that zone behind for the most part. See, for example, here: | |
# https://www.reddit.com/r/aws/comments/g5lh7h/t3m5r5_instance_types_in_use1az3/ | |
"use1-az3", | |
] | |
state = "available" | |
} | |
output "good_zone_ids" { value = data.aws_availability_zones.good_zone_ids } | |
data "aws_subnet_ids" "private_subnets" { | |
vpc_id = data.aws_vpc.vpc_id.id | |
filter { | |
name = "tag:Name" | |
values = var.subnet_filter | |
} | |
filter { | |
name = "availability-zone-id" | |
values = data.aws_availability_zones.good_zone_ids.zone_ids | |
} | |
} | |
output "private_subnets" { value = data.aws_subnet_ids.private_subnets } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment