Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Blacklisting to aws_availability_zones Data Source #8462

Closed
bflad opened this issue Apr 27, 2019 · 2 comments · Fixed by #8463
Closed

Add Blacklisting to aws_availability_zones Data Source #8462

bflad opened this issue Apr 27, 2019 · 2 comments · Fixed by #8463
Labels
enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS.
Milestone

Comments

@bflad
Copy link
Contributor

bflad commented Apr 27, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The aws_availability_zones data source is great for creating reusable Terraform configurations across AWS Regions. There are a few use cases where it might make sense to purposefully blacklist certain Availability Zones by name or zone ID.

Use Case 1: New Availability Zone Launches

When AWS adds a new Availability Zone, there is an increasing possibility that all services and functionality might not be available from day 1. Providing a blacklist is a quick way to prevent initial provisioning issues until all functionality can be verified.

Use Case 2: Known Missing Availability Zone Features

While all Availability Zones across a Region are generally similar, there have been observed cases where this is not true. Many AWS service APIs do not have a query for whether specific functionality exists per Availability Zone. e.g.

  • Missing EC2 Instance types
  • No EC2 Transit Gateway support

Use Case 3: Colocation of Services

Infrastructures may be using Availability Zone IDs to colocate networking for speed or reduction in inter-AZ data transfer costs.

Use Case 4: Purchased Availability Zone Reserved Capacity

Certain AWS services allow purchasing reserved capacity at a discounted price. Some of these reservations are based on Availability Zone.

Affected Data Source

  • aws_availability_zones

Potential Terraform Configuration

data "aws_availability_zones" "by_name" {
  blacklisted_names = ["us-west-2d"]
}

data "aws_availability_zones" "by_zone_id" {
  blacklisted_zone_ids = ["usw2-az4"]
}
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS. labels Apr 27, 2019
bflad added a commit that referenced this issue Apr 27, 2019
…sted_zone_ids arguments

Reference: #8462

Output from acceptance testing:

```
--- PASS: TestAccAWSAvailabilityZones_basic (9.66s)
--- PASS: TestAccAWSAvailabilityZones_stateFilter (9.90s)
--- PASS: TestAccAWSAvailabilityZones_BlacklistedZoneIds (10.80s)
--- PASS: TestAccAWSAvailabilityZones_BlacklistedNames (10.80s)
```
@nywilken
Copy link
Contributor

nywilken commented May 1, 2019

The enhancement to the aws_availability_zones data source has been merged and will be released with version 2.9.0 of the Terraform AWS provider.

@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS.
Projects
None yet
2 participants