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_ec2_instance_types #21850

Merged
merged 3 commits into from
Nov 19, 2021

Conversation

rrangith
Copy link
Contributor

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

Closes #21849

This pr uses code based on the existing instance_type_offerings code:
https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/ec2/instance_type_offerings_data_source.go
https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/ec2/instance_type_offerings_data_source_test.go

Output from acceptance testing:

$ make testacc TESTS=TestAccEC2InstanceTypesDataSource PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2InstanceTypesDataSource' -timeout 180m
=== RUN   TestAccEC2InstanceTypesDataSource_filter
=== PAUSE TestAccEC2InstanceTypesDataSource_filter
=== CONT  TestAccEC2InstanceTypesDataSource_filter
--- PASS: TestAccEC2InstanceTypesDataSource_filter (31.66s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/ec2        33.793s
...

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/L Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels Nov 19, 2021
@rrangith rrangith force-pushed the f-ec2_instance_types branch from 6062810 to 6b84b35 Compare November 19, 2021 18:40
@rrangith rrangith force-pushed the f-ec2_instance_types branch from 6b84b35 to 5206d2e Compare November 19, 2021 18:50
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Nov 19, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

Commercial
% make testacc TESTS=TestAccEC2InstanceTypesDataSource_ PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2InstanceTypesDataSource_' -timeout 180m
=== RUN   TestAccEC2InstanceTypesDataSource_basic
=== PAUSE TestAccEC2InstanceTypesDataSource_basic
=== RUN   TestAccEC2InstanceTypesDataSource_filter
=== PAUSE TestAccEC2InstanceTypesDataSource_filter
=== CONT  TestAccEC2InstanceTypesDataSource_basic
=== CONT  TestAccEC2InstanceTypesDataSource_filter
--- PASS: TestAccEC2InstanceTypesDataSource_filter (21.10s)
--- PASS: TestAccEC2InstanceTypesDataSource_basic (21.80s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	25.337s
GovCloud
% make testacc TESTS=TestAccEC2InstanceTypesDataSource_ PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run='TestAccEC2InstanceTypesDataSource_' -timeout 180m
=== RUN   TestAccEC2InstanceTypesDataSource_basic
=== PAUSE TestAccEC2InstanceTypesDataSource_basic
=== RUN   TestAccEC2InstanceTypesDataSource_filter
=== PAUSE TestAccEC2InstanceTypesDataSource_filter
=== CONT  TestAccEC2InstanceTypesDataSource_basic
=== CONT  TestAccEC2InstanceTypesDataSource_filter
--- PASS: TestAccEC2InstanceTypesDataSource_filter (22.18s)
--- PASS: TestAccEC2InstanceTypesDataSource_basic (22.24s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	25.698s

@ewbankkit
Copy link
Contributor

@rrangith Thanks for the contribution 🎉 👏.

I tweaked the acceptance test a bit to

  1. Add a test with no filter
  2. Get the test with a filter passing in GovCloud

@ewbankkit ewbankkit merged commit 165f249 into hashicorp:main Nov 19, 2021
@github-actions github-actions bot added this to the v3.67.0 milestone Nov 19, 2021
@github-actions
Copy link

github-actions bot commented Dec 1, 2021

This functionality has been released in v3.67.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. Thank you!

@github-actions
Copy link

github-actions bot commented Jun 7, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 7, 2022
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. 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.

New Data Source: aws_ec2_instance_types
2 participants