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

New data source - aws_regions #12269

Merged
merged 5 commits into from
Apr 15, 2020

Conversation

szczad
Copy link

@szczad szczad commented Mar 5, 2020

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment 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 pull request followers and do not help prioritize the request

Relates: #12270

Release note for CHANGELOG:

* **New Data Source:** `aws_regions`

This pull request adds another resource aws_regions that can list all available regions by op-in status: opted-in, not-opted-in and opt-in-not-required (docs)

Output from acceptance testing:

--- PASS: TestAccDataSourceAwsRegionsAllRegions (29.20s)
--- PASS: TestAccDataSourceAwsRegionsBasic (29.30s)
--- PASS: TestAccDataSourceAwsRegionsOptIn (63.63s)

@ghost ghost added size/L Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Mar 5, 2020
@szczad szczad force-pushed the feature/data-source-aws-resources branch 2 times, most recently from 171b7cf to 634339b Compare March 5, 2020 08:50
@szczad szczad changed the title Feature/data source aws resources New data source - aws_resources Mar 5, 2020
@szczad szczad marked this pull request as ready for review March 5, 2020 09:57
@szczad szczad requested a review from a team March 5, 2020 09:57
@ewbankkit
Copy link
Contributor

@szczad Thanks for this.
Could you please add a filter block to this new data source, similar to other EC2 service data sources (those that currently don't are being tracked via #11994)?
You could then remove the explicit opt_in_status argument, although we would then loose the plan-time validation - Your choice.

@szczad
Copy link
Author

szczad commented Mar 5, 2020

@ewbankkit Is there any announcement for that? Apart from the comment I've dug out there is no guideline for that approach.

@bflad bflad added new-data-source Introduces a new data source. service/ec2 Issues and PRs that pertain to the ec2 service. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 5, 2020
@ewbankkit
Copy link
Contributor

@szczad Could you please modify the PR's title: aws_resources -> aws_regions and add underscores to the acceptance test function names: #9950?
Thanks.

@szczad szczad changed the title New data source - aws_resources New data source - aws_regions Mar 5, 2020
@szczad
Copy link
Author

szczad commented Mar 5, 2020

@ewbankkit Ahh... Thanks for catching that. Simple typo.

@ewbankkit
Copy link
Contributor

Verified acceptance tests:

% make testacc TEST=./aws TESTARGS='-run=TestAccDataSourceAwsRegions_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 1 -run=TestAccDataSourceAwsRegions_ -timeout 120m
=== RUN   TestAccDataSourceAwsRegions_Basic
=== PAUSE TestAccDataSourceAwsRegions_Basic
=== RUN   TestAccDataSourceAwsRegions_OptIn
=== PAUSE TestAccDataSourceAwsRegions_OptIn
=== RUN   TestAccDataSourceAwsRegions_AllRegions
=== PAUSE TestAccDataSourceAwsRegions_AllRegions
=== CONT  TestAccDataSourceAwsRegions_Basic
--- PASS: TestAccDataSourceAwsRegions_Basic (26.88s)
=== CONT  TestAccDataSourceAwsRegions_AllRegions
--- PASS: TestAccDataSourceAwsRegions_AllRegions (27.00s)
=== CONT  TestAccDataSourceAwsRegions_OptIn
--- PASS: TestAccDataSourceAwsRegions_OptIn (58.98s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	114.160s

Provides list of all enabled AWS regions
---

# Data Source: aws_region
Copy link
Contributor

Choose a reason for hiding this comment

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

aws_regionS?

Copy link
Author

Choose a reason for hiding this comment

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

Good catch! Fixed the typo.

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Hi @szczad 👋 Thank you for submitting this. Its looking pretty good, just some touch up work and this should be good to go. Please reach out with any questions or if you do not have time to implement the feedback. 👍

aws/data_source_aws_regions.go Outdated Show resolved Hide resolved
aws/data_source_aws_regions.go Outdated Show resolved Hide resolved
aws/data_source_aws_regions_test.go Outdated Show resolved Hide resolved
aws/data_source_aws_regions_test.go Outdated Show resolved Hide resolved
website/docs/d/regions.html.markdown Outdated Show resolved Hide resolved
website/docs/d/regions.html.markdown Outdated Show resolved Hide resolved
website/docs/d/regions.html.markdown Outdated Show resolved Hide resolved
website/docs/d/regions.html.markdown Outdated Show resolved Hide resolved
website/docs/d/regions.html.markdown Outdated Show resolved Hide resolved
website/docs/d/regions.html.markdown Outdated Show resolved Hide resolved
@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Mar 16, 2020
@bflad bflad self-assigned this Mar 16, 2020
@bflad bflad linked an issue Mar 16, 2020 that may be closed by this pull request
Grzegorz Szczudlik added 4 commits March 31, 2020 12:27
Change the way that data source handles all the regions

Readme for data.aws_regions

Tests for data.aws_regions data source

Add the data source to master document
@szczad szczad force-pushed the feature/data-source-aws-resources branch from 23d236c to 1592ad9 Compare March 31, 2020 10:28
website/docs/d/regions.html.markdown Outdated Show resolved Hide resolved
website/docs/d/regions.html.markdown Outdated Show resolved Hide resolved
@bflad bflad added this to the v2.58.0 milestone Apr 15, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Thanks so much for your work here, @szczad 🚀

Output from acceptance testing:

--- PASS: TestAccDataSourceAwsRegions_Basic (15.47s)
--- PASS: TestAccDataSourceAwsRegions_AllRegions (15.52s)
--- PASS: TestAccDataSourceAwsRegions_Filter (15.53s)

@bflad bflad merged commit 071f85f into hashicorp:master Apr 15, 2020
bflad added a commit that referenced this pull request Apr 15, 2020
@ghost
Copy link

ghost commented Apr 17, 2020

This has been released in version 2.58.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 May 15, 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 May 15, 2020
@breathingdust breathingdust removed the waiting-response Maintainers are waiting on response from community or contributor. label Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-data-source Introduces a new data source. provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS Regions discovery by opt-in status
5 participants