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

Tech debt: Use service package API client withExtraOptions mechanism #41211

Merged
merged 22 commits into from
Feb 4, 2025

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Feb 3, 2025

Description

Use the service package API client withExtraOptions mechanism introduced in #41109 to specify extra Options. This allows all (except simpledb and meta) API client factory functions to be generated.

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccAPIGatewayRestAPI_basic' PKG=apigateway
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/apigateway/... -v -count 1 -parallel 20  -run=TestAccAPIGatewayRestAPI_basic -timeout 360m -vet=off
2025/02/03 15:24:47 Initializing Terraform AWS Provider...
=== RUN   TestAccAPIGatewayRestAPI_basic
=== PAUSE TestAccAPIGatewayRestAPI_basic
=== CONT  TestAccAPIGatewayRestAPI_basic
--- PASS: TestAccAPIGatewayRestAPI_basic (15.83s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/apigateway	21.486s
% make testacc TESTARGS='-run=TestAccSiteVPNGateway_' PKG=ec2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/ec2/... -v -count 1 -parallel 20  -run=TestAccSiteVPNGateway_ -timeout 360m -vet=off
2025/02/03 15:28:37 Initializing Terraform AWS Provider...
=== RUN   TestAccSiteVPNGateway_basic
=== PAUSE TestAccSiteVPNGateway_basic
=== RUN   TestAccSiteVPNGateway_withAvailabilityZoneSetToState
=== PAUSE TestAccSiteVPNGateway_withAvailabilityZoneSetToState
=== RUN   TestAccSiteVPNGateway_amazonSideASN
=== PAUSE TestAccSiteVPNGateway_amazonSideASN
=== RUN   TestAccSiteVPNGateway_disappears
=== PAUSE TestAccSiteVPNGateway_disappears
=== RUN   TestAccSiteVPNGateway_reattach
=== PAUSE TestAccSiteVPNGateway_reattach
=== RUN   TestAccSiteVPNGateway_tags
=== PAUSE TestAccSiteVPNGateway_tags
=== CONT  TestAccSiteVPNGateway_basic
=== CONT  TestAccSiteVPNGateway_disappears
=== CONT  TestAccSiteVPNGateway_amazonSideASN
=== CONT  TestAccSiteVPNGateway_withAvailabilityZoneSetToState
=== CONT  TestAccSiteVPNGateway_tags
=== CONT  TestAccSiteVPNGateway_reattach
--- PASS: TestAccSiteVPNGateway_amazonSideASN (107.58s)
--- PASS: TestAccSiteVPNGateway_withAvailabilityZoneSetToState (107.63s)
--- PASS: TestAccSiteVPNGateway_disappears (116.31s)
--- PASS: TestAccSiteVPNGateway_tags (147.34s)
--- PASS: TestAccSiteVPNGateway_basic (196.87s)
--- PASS: TestAccSiteVPNGateway_reattach (246.77s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/ec2	252.631s
% make testacc TESTARGS='-run=TestAccRoute53RecoveryReadinessResourceSet_basic' PKG=route53recoveryreadiness        
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/route53recoveryreadiness/... -v -count 1 -parallel 20  -run=TestAccRoute53RecoveryReadinessResourceSet_basic -timeout 360m -vet=off
2025/02/03 15:35:01 Initializing Terraform AWS Provider...
=== RUN   TestAccRoute53RecoveryReadinessResourceSet_basic
=== PAUSE TestAccRoute53RecoveryReadinessResourceSet_basic
=== RUN   TestAccRoute53RecoveryReadinessResourceSet_basicDNSTargetResource
=== PAUSE TestAccRoute53RecoveryReadinessResourceSet_basicDNSTargetResource
=== CONT  TestAccRoute53RecoveryReadinessResourceSet_basic
=== CONT  TestAccRoute53RecoveryReadinessResourceSet_basicDNSTargetResource
--- PASS: TestAccRoute53RecoveryReadinessResourceSet_basic (15.38s)
--- PASS: TestAccRoute53RecoveryReadinessResourceSet_basicDNSTargetResource (15.41s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/route53recoveryreadiness	21.197s
% make testacc TESTARGS='-run=TestAccDynamoDBTable_basic' PKG=dynamodb
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/dynamodb/... -v -count 1 -parallel 20  -run=TestAccDynamoDBTable_basic -timeout 360m -vet=off
2025/02/03 15:37:53 Initializing Terraform AWS Provider...
=== RUN   TestAccDynamoDBTable_basic
=== PAUSE TestAccDynamoDBTable_basic
=== CONT  TestAccDynamoDBTable_basic
--- PASS: TestAccDynamoDBTable_basic (22.87s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	28.423s
% make testacc TESTARGS='-run=TestAccS3Bucket_Basic_basic' PKG=s3     
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.5 test ./internal/service/s3/... -v -count 1 -parallel 20  -run=TestAccS3Bucket_Basic_basic -timeout 360m -vet=off
2025/02/03 15:50:00 Initializing Terraform AWS Provider...
=== RUN   TestAccS3Bucket_Basic_basic
=== PAUSE TestAccS3Bucket_Basic_basic
=== CONT  TestAccS3Bucket_Basic_basic
--- PASS: TestAccS3Bucket_Basic_basic (18.99s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/s3	24.736s

@ewbankkit ewbankkit changed the title Tech debt: Use service package API client withExtraOptions Tech debt: Use service package API client withExtraOptions mechanism Feb 3, 2025
Copy link

github-actions bot commented Feb 3, 2025

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added service/s3 Issues and PRs that pertain to the s3 service. service/apigateway Issues and PRs that pertain to the apigateway service. service/lightsail Issues and PRs that pertain to the lightsail service. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/organizations Issues and PRs that pertain to the organizations service. service/appsync Issues and PRs that pertain to the appsync service. service/kinesis Issues and PRs that pertain to the kinesis service. service/cloudformation Issues and PRs that pertain to the cloudformation service. service/cloudhsmv2 Issues and PRs that pertain to the cloudhsmv2 service. labels Feb 3, 2025
@github-actions github-actions bot added service/fms Issues and PRs that pertain to the fms service. service/sts Issues and PRs that pertain to the sts service. service/kafka Issues and PRs that pertain to the kafka service. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. service/ssoadmin Issues and PRs that pertain to the ssoadmin service. service/schemas Issues and PRs that pertain to the schemas service. service/route53recoveryreadiness Issues and PRs that pertain to the route53recoveryreadiness service. service/route53recoverycontrolconfig Issues and PRs that pertain to the route53recoverycontrolconfig service. generators Relates to code generators. service/chatbot Issues and PRs that pertain to the chatbot service. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. labels Feb 3, 2025
@github-actions github-actions bot added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Feb 3, 2025
@ewbankkit ewbankkit marked this pull request as ready for review February 3, 2025 21:30
@ewbankkit ewbankkit requested a review from a team as a code owner February 3, 2025 21:30
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM

Can we update this section of the contributor guide to replace the custom NewClient implementation with a withExtraOptions example?

https://hashicorp.github.io/terraform-provider-aws/add-a-new-service/#customizing-a-new-service-client

@ewbankkit
Copy link
Contributor Author

@jar-b Contributors Guide updated.

Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@ewbankkit ewbankkit merged commit 8f8719d into main Feb 4, 2025
40 checks passed
@ewbankkit ewbankkit deleted the td-service-package.withExtraOptions branch February 4, 2025 19:42
@github-actions github-actions bot added this to the v5.86.0 milestone Feb 4, 2025
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Feb 6, 2025
Copy link

github-actions bot commented Feb 6, 2025

This functionality has been released in v5.86.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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generators Relates to code generators. service/apigateway Issues and PRs that pertain to the apigateway service. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. service/appsync Issues and PRs that pertain to the appsync service. service/chatbot Issues and PRs that pertain to the chatbot service. service/cloudformation Issues and PRs that pertain to the cloudformation service. service/cloudhsmv2 Issues and PRs that pertain to the cloudhsmv2 service. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/fms Issues and PRs that pertain to the fms service. service/kafka Issues and PRs that pertain to the kafka service. service/kinesis Issues and PRs that pertain to the kinesis service. service/lightsail Issues and PRs that pertain to the lightsail service. service/organizations Issues and PRs that pertain to the organizations service. service/route53recoverycontrolconfig Issues and PRs that pertain to the route53recoverycontrolconfig service. service/route53recoveryreadiness Issues and PRs that pertain to the route53recoveryreadiness service. service/s3 Issues and PRs that pertain to the s3 service. service/schemas Issues and PRs that pertain to the schemas service. service/ssoadmin Issues and PRs that pertain to the ssoadmin service. service/sts Issues and PRs that pertain to the sts service. 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.

2 participants