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

Ignore/Fix and Enable awsproviderlint AWSAT003: Regions should not be hardcoded, use aws_region and aws_availability_zones data sources instead #12995

Closed
breathingdust opened this issue Apr 24, 2020 · 5 comments · Fixed by #17196
Assignees
Labels
linter Pertains to changes to or issues with the various linters. partition/aws-us-gov Pertains to the aws-us-gov partition. provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Milestone

Comments

@breathingdust
Copy link
Member

breathingdust commented Apr 24, 2020

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 other comments that do not add relevant new information or questions, 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

To ensure test configurations are region and partition agnostic, any hardcoded AZ identifiers ([a-z]{2}(-[a-z]+)+-[1-9][0-9](-[a-z]+-[1-9][0-9])?[a-z]) should be replaced with the aws_availability_zones data source.

To ensure test configurations are region and partition agnostic, any hardcoded Region identifiers ([a-z]{2}(-[a-z]+)+-[1-9][0-9]*) should be replaced with the aws_region data source.

Flagged Code

In test configuration:

us-west-2
us-west-2a

Passing Code

In test configuration:

data "aws_region" "current" {}
data "aws_availability_zones" "available" {
  # ... configuration ...
}

Definition of Done

  • AWSAT003 check enabled in GNUmakefile
  • CI testing passes
@breathingdust breathingdust added technical-debt Addresses areas of the codebase that need refactoring or redesign. provider Pertains to the provider itself, rather than any interaction with AWS. labels Apr 24, 2020
@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Apr 24, 2020
@YakDriver
Copy link
Member

YakDriver commented Jul 29, 2020

This was added as AWSAT003. This is the central management issue.

Phase 1 Fixes needed (ended with #14857):

@YakDriver YakDriver self-assigned this Aug 6, 2020
@YakDriver YakDriver added the partition/aws-us-gov Pertains to the aws-us-gov partition. label Aug 27, 2020
@github-actions github-actions bot added this to the v3.25.0 milestone Jan 20, 2021
@ghost
Copy link

ghost commented Jan 22, 2021

This has been released in version 3.25.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Feb 20, 2021

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 as resolved and limited conversation to collaborators Feb 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
linter Pertains to changes to or issues with the various linters. partition/aws-us-gov Pertains to the aws-us-gov partition. provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service. technical-debt Addresses areas of the codebase that need refactoring or redesign.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants