-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[AWS SDK for Go Migration] Meta Data Sources (Region) Service #39389
[AWS SDK for Go Migration] Meta Data Sources (Region) Service #39389
Conversation
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @hskiba 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
64c13a6
to
07827d3
Compare
% make testacc TESTARGS='-run=TestAccMetaRegionDataSource_' PKG=meta make: Verifying source code with gofmt... ==> Checking that code complies with gofmt requirements... TF_ACC=1 go1.22.7 test ./internal/service/meta/... -v -count 1 -parallel 20 -run=TestAccMetaRegionDataSource_ -timeout 360m === RUN TestAccMetaRegionDataSource_basic === PAUSE TestAccMetaRegionDataSource_basic === RUN TestAccMetaRegionDataSource_endpoint === PAUSE TestAccMetaRegionDataSource_endpoint === RUN TestAccMetaRegionDataSource_endpointAndName === PAUSE TestAccMetaRegionDataSource_endpointAndName === RUN TestAccMetaRegionDataSource_name === PAUSE TestAccMetaRegionDataSource_name === CONT TestAccMetaRegionDataSource_basic === CONT TestAccMetaRegionDataSource_endpointAndName === CONT TestAccMetaRegionDataSource_name === CONT TestAccMetaRegionDataSource_endpoint --- PASS: TestAccMetaRegionDataSource_basic (8.25s) --- PASS: TestAccMetaRegionDataSource_endpointAndName (9.59s) --- PASS: TestAccMetaRegionDataSource_name (9.59s) --- PASS: TestAccMetaRegionDataSource_endpoint (9.62s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/meta 14.858s
…gratable equivalent of 'Partition.Services()'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccMetaARNDataSource_' PKG=meta
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.7 test ./internal/service/meta/... -v -count 1 -parallel 20 -run=TestAccMetaARNDataSource_ -timeout 360m
=== RUN TestAccMetaARNDataSource_basic
=== PAUSE TestAccMetaARNDataSource_basic
=== RUN TestAccMetaARNDataSource_s3Bucket
=== PAUSE TestAccMetaARNDataSource_s3Bucket
=== CONT TestAccMetaARNDataSource_basic
=== CONT TestAccMetaARNDataSource_s3Bucket
--- PASS: TestAccMetaARNDataSource_s3Bucket (7.70s)
--- PASS: TestAccMetaARNDataSource_basic (7.70s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/meta 12.796s
% make testacc TESTARGS='-run=TestAccMetaBillingServiceAccountDataSource_' PKG=meta
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.7 test ./internal/service/meta/... -v -count 1 -parallel 20 -run=TestAccMetaBillingServiceAccountDataSource_ -timeout 360m
=== RUN TestAccMetaBillingServiceAccountDataSource_basic
=== PAUSE TestAccMetaBillingServiceAccountDataSource_basic
=== CONT TestAccMetaBillingServiceAccountDataSource_basic
--- PASS: TestAccMetaBillingServiceAccountDataSource_basic (7.46s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/meta 12.445s
% make testacc TESTARGS='-run=TestAccMetaDefaultTagsDataSource_' PKG=meta
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.7 test ./internal/service/meta/... -v -count 1 -parallel 20 -run=TestAccMetaDefaultTagsDataSource_ -timeout 360m
=== RUN TestAccMetaDefaultTagsDataSource_basic
=== PAUSE TestAccMetaDefaultTagsDataSource_basic
=== RUN TestAccMetaDefaultTagsDataSource_empty
=== PAUSE TestAccMetaDefaultTagsDataSource_empty
=== RUN TestAccMetaDefaultTagsDataSource_multiple
=== PAUSE TestAccMetaDefaultTagsDataSource_multiple
=== RUN TestAccMetaDefaultTagsDataSource_ignore
=== PAUSE TestAccMetaDefaultTagsDataSource_ignore
=== CONT TestAccMetaDefaultTagsDataSource_basic
=== CONT TestAccMetaDefaultTagsDataSource_multiple
=== CONT TestAccMetaDefaultTagsDataSource_empty
=== CONT TestAccMetaDefaultTagsDataSource_ignore
--- PASS: TestAccMetaDefaultTagsDataSource_basic (7.01s)
--- PASS: TestAccMetaDefaultTagsDataSource_multiple (7.01s)
--- PASS: TestAccMetaDefaultTagsDataSource_empty (8.17s)
--- PASS: TestAccMetaDefaultTagsDataSource_ignore (12.58s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/meta 17.661s
% make testacc TESTARGS='-run=TestAccMetaIPRangesDataSource_' PKG=meta
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.7 test ./internal/service/meta/... -v -count 1 -parallel 20 -run=TestAccMetaIPRangesDataSource_ -timeout 360m
=== RUN TestAccMetaIPRangesDataSource_basic
=== PAUSE TestAccMetaIPRangesDataSource_basic
=== RUN TestAccMetaIPRangesDataSource_none
=== PAUSE TestAccMetaIPRangesDataSource_none
=== RUN TestAccMetaIPRangesDataSource_url
=== PAUSE TestAccMetaIPRangesDataSource_url
=== RUN TestAccMetaIPRangesDataSource_uppercase
=== PAUSE TestAccMetaIPRangesDataSource_uppercase
=== CONT TestAccMetaIPRangesDataSource_basic
=== CONT TestAccMetaIPRangesDataSource_url
=== CONT TestAccMetaIPRangesDataSource_none
=== CONT TestAccMetaIPRangesDataSource_uppercase
--- PASS: TestAccMetaIPRangesDataSource_basic (9.75s)
--- PASS: TestAccMetaIPRangesDataSource_url (9.87s)
--- PASS: TestAccMetaIPRangesDataSource_uppercase (10.10s)
--- PASS: TestAccMetaIPRangesDataSource_none (10.35s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/meta 15.309s
% make testacc TESTARGS='-run=TestAccMetaPartitionDataSource_' PKG=meta
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.7 test ./internal/service/meta/... -v -count 1 -parallel 20 -run=TestAccMetaPartitionDataSource_ -timeout 360m
=== RUN TestAccMetaPartitionDataSource_basic
=== PAUSE TestAccMetaPartitionDataSource_basic
=== CONT TestAccMetaPartitionDataSource_basic
--- PASS: TestAccMetaPartitionDataSource_basic (7.50s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/meta 12.464s
% make testacc TESTARGS='-run=TestAccMetaRegionDataSource_' PKG=meta
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.7 test ./internal/service/meta/... -v -count 1 -parallel 20 -run=TestAccMetaRegionDataSource_ -timeout 360m
=== RUN TestAccMetaRegionDataSource_basic
=== PAUSE TestAccMetaRegionDataSource_basic
=== RUN TestAccMetaRegionDataSource_endpoint
=== PAUSE TestAccMetaRegionDataSource_endpoint
=== RUN TestAccMetaRegionDataSource_endpointAndName
=== PAUSE TestAccMetaRegionDataSource_endpointAndName
=== RUN TestAccMetaRegionDataSource_name
=== PAUSE TestAccMetaRegionDataSource_name
=== CONT TestAccMetaRegionDataSource_basic
=== CONT TestAccMetaRegionDataSource_endpointAndName
=== CONT TestAccMetaRegionDataSource_name
=== CONT TestAccMetaRegionDataSource_endpoint
--- PASS: TestAccMetaRegionDataSource_basic (8.09s)
--- PASS: TestAccMetaRegionDataSource_endpointAndName (9.54s)
--- PASS: TestAccMetaRegionDataSource_name (9.64s)
--- PASS: TestAccMetaRegionDataSource_endpoint (9.64s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/meta 14.413s
% make testacc TESTARGS='-run=TestAccMetaRegionsDataSource_' PKG=meta
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.7 test ./internal/service/meta/... -v -count 1 -parallel 20 -run=TestAccMetaRegionsDataSource_ -timeout 360m
=== RUN TestAccMetaRegionsDataSource_basic
=== PAUSE TestAccMetaRegionsDataSource_basic
=== RUN TestAccMetaRegionsDataSource_filter
=== PAUSE TestAccMetaRegionsDataSource_filter
=== RUN TestAccMetaRegionsDataSource_allRegions
=== PAUSE TestAccMetaRegionsDataSource_allRegions
=== RUN TestAccMetaRegionsDataSource_nonExistentRegion
=== PAUSE TestAccMetaRegionsDataSource_nonExistentRegion
=== CONT TestAccMetaRegionsDataSource_basic
=== CONT TestAccMetaRegionsDataSource_allRegions
=== CONT TestAccMetaRegionsDataSource_filter
=== CONT TestAccMetaRegionsDataSource_nonExistentRegion
--- PASS: TestAccMetaRegionsDataSource_allRegions (9.49s)
--- PASS: TestAccMetaRegionsDataSource_filter (9.49s)
--- PASS: TestAccMetaRegionsDataSource_basic (9.52s)
--- PASS: TestAccMetaRegionsDataSource_nonExistentRegion (9.56s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/meta 14.645s
% make testacc TESTARGS='-run=TestAccMetaServiceDataSource_' PKG=meta
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.7 test ./internal/service/meta/... -v -count 1 -parallel 20 -run=TestAccMetaServiceDataSource_ -timeout 360m
=== RUN TestAccMetaServiceDataSource_basic
=== PAUSE TestAccMetaServiceDataSource_basic
=== RUN TestAccMetaServiceDataSource_irregularServiceID
=== PAUSE TestAccMetaServiceDataSource_irregularServiceID
=== RUN TestAccMetaServiceDataSource_irregularServiceIDUnsupported
=== PAUSE TestAccMetaServiceDataSource_irregularServiceIDUnsupported
=== RUN TestAccMetaServiceDataSource_byReverseDNSName
=== PAUSE TestAccMetaServiceDataSource_byReverseDNSName
=== RUN TestAccMetaServiceDataSource_byDNSName
=== PAUSE TestAccMetaServiceDataSource_byDNSName
=== RUN TestAccMetaServiceDataSource_byParts
=== PAUSE TestAccMetaServiceDataSource_byParts
=== RUN TestAccMetaServiceDataSource_unsupported
=== PAUSE TestAccMetaServiceDataSource_unsupported
=== CONT TestAccMetaServiceDataSource_basic
=== CONT TestAccMetaServiceDataSource_byDNSName
=== CONT TestAccMetaServiceDataSource_unsupported
=== CONT TestAccMetaServiceDataSource_byParts
=== CONT TestAccMetaServiceDataSource_irregularServiceIDUnsupported
=== CONT TestAccMetaServiceDataSource_byReverseDNSName
=== CONT TestAccMetaServiceDataSource_irregularServiceID
--- PASS: TestAccMetaServiceDataSource_byDNSName (9.33s)
--- PASS: TestAccMetaServiceDataSource_irregularServiceIDUnsupported (9.34s)
--- PASS: TestAccMetaServiceDataSource_unsupported (9.44s)
--- PASS: TestAccMetaServiceDataSource_byParts (9.45s)
--- PASS: TestAccMetaServiceDataSource_irregularServiceID (9.52s)
--- PASS: TestAccMetaServiceDataSource_byReverseDNSName (9.52s)
--- PASS: TestAccMetaServiceDataSource_basic (9.53s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/meta 14.907s
% make testacc TESTARGS='-run=TestAccMetaServicePrincipalDataSource_' PKG=meta
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.7 test ./internal/service/meta/... -v -count 1 -parallel 20 -run=TestAccMetaServicePrincipalDataSource_ -timeout 360m
=== RUN TestAccMetaServicePrincipalDataSource_basic
=== PAUSE TestAccMetaServicePrincipalDataSource_basic
=== RUN TestAccMetaServicePrincipalDataSource_MissingService
=== PAUSE TestAccMetaServicePrincipalDataSource_MissingService
=== RUN TestAccMetaServicePrincipalDataSource_ByRegion
=== RUN TestAccMetaServicePrincipalDataSource_ByRegion/us-east-1
=== PAUSE TestAccMetaServicePrincipalDataSource_ByRegion/us-east-1
=== RUN TestAccMetaServicePrincipalDataSource_ByRegion/cn-north-1
=== PAUSE TestAccMetaServicePrincipalDataSource_ByRegion/cn-north-1
=== RUN TestAccMetaServicePrincipalDataSource_ByRegion/us-gov-east-1
=== PAUSE TestAccMetaServicePrincipalDataSource_ByRegion/us-gov-east-1
=== RUN TestAccMetaServicePrincipalDataSource_ByRegion/us-iso-east-1
=== PAUSE TestAccMetaServicePrincipalDataSource_ByRegion/us-iso-east-1
=== RUN TestAccMetaServicePrincipalDataSource_ByRegion/us-isob-east-1
=== PAUSE TestAccMetaServicePrincipalDataSource_ByRegion/us-isob-east-1
=== RUN TestAccMetaServicePrincipalDataSource_ByRegion/eu-isoe-west-1
=== PAUSE TestAccMetaServicePrincipalDataSource_ByRegion/eu-isoe-west-1
=== CONT TestAccMetaServicePrincipalDataSource_ByRegion/us-east-1
=== CONT TestAccMetaServicePrincipalDataSource_ByRegion/eu-isoe-west-1
=== CONT TestAccMetaServicePrincipalDataSource_ByRegion/us-iso-east-1
=== CONT TestAccMetaServicePrincipalDataSource_ByRegion/us-gov-east-1
=== CONT TestAccMetaServicePrincipalDataSource_ByRegion/us-isob-east-1
=== CONT TestAccMetaServicePrincipalDataSource_ByRegion/cn-north-1
--- PASS: TestAccMetaServicePrincipalDataSource_ByRegion (0.00s)
--- PASS: TestAccMetaServicePrincipalDataSource_ByRegion/us-east-1 (9.35s)
--- PASS: TestAccMetaServicePrincipalDataSource_ByRegion/us-isob-east-1 (9.42s)
--- PASS: TestAccMetaServicePrincipalDataSource_ByRegion/us-gov-east-1 (9.88s)
--- PASS: TestAccMetaServicePrincipalDataSource_ByRegion/us-iso-east-1 (9.98s)
--- PASS: TestAccMetaServicePrincipalDataSource_ByRegion/cn-north-1 (10.07s)
--- PASS: TestAccMetaServicePrincipalDataSource_ByRegion/eu-isoe-west-1 (10.08s)
=== RUN TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion
=== RUN TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/cloudhsm
=== PAUSE TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/cloudhsm
=== RUN TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/config
=== PAUSE TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/config
=== RUN TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/logs
=== PAUSE TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/logs
=== RUN TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/workspaces
=== PAUSE TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/workspaces
=== RUN TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-isob-east-1/dms
=== PAUSE TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-isob-east-1/dms
=== RUN TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-isob-east-1/logs
=== PAUSE TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-isob-east-1/logs
=== RUN TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/codedeploy
=== PAUSE TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/codedeploy
=== RUN TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/elasticmapreduce
=== PAUSE TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/elasticmapreduce
=== RUN TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/logs
=== PAUSE TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/logs
=== CONT TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/cloudhsm
=== CONT TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-isob-east-1/logs
=== CONT TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/elasticmapreduce
=== CONT TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/logs
=== CONT TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-isob-east-1/dms
=== CONT TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/codedeploy
=== CONT TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/logs
=== CONT TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/workspaces
=== CONT TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/config
--- PASS: TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion (0.00s)
--- PASS: TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-isob-east-1/dms (11.30s)
--- PASS: TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/logs (11.56s)
--- PASS: TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/codedeploy (11.60s)
--- PASS: TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/logs (11.63s)
--- PASS: TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/workspaces (11.93s)
--- PASS: TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/config (12.09s)
--- PASS: TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-isob-east-1/logs (12.09s)
--- PASS: TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/cn-north-1/elasticmapreduce (12.17s)
--- PASS: TestAccMetaServicePrincipalDataSource_UniqueForServiceInRegion/us-iso-east-1/cloudhsm (12.19s)
=== CONT TestAccMetaServicePrincipalDataSource_basic
=== CONT TestAccMetaServicePrincipalDataSource_MissingService
--- PASS: TestAccMetaServicePrincipalDataSource_MissingService (0.91s)
--- PASS: TestAccMetaServicePrincipalDataSource_basic (7.32s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/meta 34.925s
@hskiba Thanks for the contribution 🎉 👏. To complete the migration of the |
Sorry I missed that.
Thank you! 🙏 |
This functionality has been released in v5.69.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! |
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. |
This resolves problems using region lookup for the newly-launched Malaysia region
ap-southeast-5
(see #36224).This migrates the region data source to AWS SDK v2. In v2, the
endpoints
package is no longer available. Now, regions need to be queried in the account using the configured client. I chose to use the ec2 client given the current data source supports lookup using the EC2 endpoint. The change in behavior is that if a region is valid but is not available to the account, e.g.,cn-north-1
when in the standard partition, the region lookup by name will fail. A number of tests that were successful before because they were static lookups embedded in the SDK are no longer successful when running outside of their partition. I adjusted these tests (TestAccMetaServicePrincipal
) to be skipped if not being run from the test case region's partition.Relations
Relates #36188.
Closes #39224.
Relates #38989.
References
Output from Acceptance Testing