Skip to content

Conversation

@setheliot
Copy link
Contributor

@setheliot setheliot commented Dec 12, 2025

Description

This change excludes local zones that the user may have opted into in their region of choice

Motivation and Context

Without this change, the examples may attempt to deploy to local zones, which will cause failures of the example apply

seth:complete/ (master✗) $ terraform console <<< 'data.aws_availability_zones.available.names'
tolist([
  "us-east-1-atl-2a",
  "us-east-1-bos-1a",
  "us-east-1-chi-2a",
  "us-east-1-nyc-2a",
  "us-east-1a",
  "us-east-1b",
  "us-east-1c",
  "us-east-1d",
  "us-east-1e",
  "us-east-1f",
])



seth:~/ $ aws ec2 describe-availability-zones --region us-east-1 \
    --filters "Name=opt-in-status,Values=opt-in-not-required" \
    --query 'AvailabilityZones[].ZoneName' --output json
[
    "us-east-1a",
    "us-east-1b",
    "us-east-1c",
    "us-east-1d",
    "us-east-1e",
    "us-east-1f"
]

Breaking Changes

none

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
    • /examples/complete
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request
seth:modules/ (ecs-az-fix) $ pwd                                                                                                                                              [12:01:09]
/Users/seth/github/terraform-aws-ecs/modules
seth:modules/ (ecs-az-fix) $ pre-commit run -a                                                                                                                                [12:01:11]
Terraform wrapper with for_each in module................................Passed
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Terraform validate with tflint...........................................Passed
Terraform validate.......................................................Passed
check for merge conflicts................................................Passed
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed

@setheliot setheliot changed the title ECA AZ fix ECS AZ fix Dec 12, 2025

data "aws_availability_zones" "available" {}
data "aws_availability_zones" "available" {
filter {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryantbiggs
Copy link
Member

if we're going to add it, lets add it to all examples to be consistent

@bryantbiggs bryantbiggs changed the title ECS AZ fix docs: Exclude local zones from aws_availability_zones data source in examples when retrieving list of available zones Dec 12, 2025
@setheliot
Copy link
Contributor Author

@bryantbiggs I have updated everything you asked for, and ran a fresh pre-commit run -a

seth:examples/ (ecs-az-fix✗) $ pre-commit run -a                                                                                                                              [20:13:19]
Terraform wrapper with for_each in module................................Passed
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Terraform validate with tflint...........................................Passed
Terraform validate.......................................................Passed
check for merge conflicts................................................Passed
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants