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

Fix dynamodb make a DescribeTable call per replica #35630

Merged

Conversation

szesch
Copy link
Contributor

@szesch szesch commented Feb 3, 2024

Description

This addresses #35629. Instead of making a single DynamoDB DescribeTable call to get information on replicas, this makes a call per replica. This was already done for getting information on replica streams, so that code was moved out of replicaStream and into enrichReplicas where it can be used to obtain both the stream and kms key information.

Relations

Closes #35629

References

Background and context is in #35629

Copy link

github-actions bot commented Feb 3, 2024

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/dynamodb Issues and PRs that pertain to the dynamodb service. size/S Managed by automation to categorize the size of a PR. and removed service/dynamodb Issues and PRs that pertain to the dynamodb service. labels Feb 3, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 3, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @szesch 👋

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! 😃

@ewbankkit ewbankkit added bug Addresses a defect in current functionality. service/dynamodb Issues and PRs that pertain to the dynamodb service. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 5, 2024
% make testacc TESTARGS='-run=TestAccDynamoDBKinesisStreamingDestination_' PKG=dynamodb
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/dynamodb/... -v -count 1 -parallel 20  -run=TestAccDynamoDBKinesisStreamingDestination_ -timeout 360m
=== RUN   TestAccDynamoDBKinesisStreamingDestination_basic
=== PAUSE TestAccDynamoDBKinesisStreamingDestination_basic
=== RUN   TestAccDynamoDBKinesisStreamingDestination_disappears
=== PAUSE TestAccDynamoDBKinesisStreamingDestination_disappears
=== RUN   TestAccDynamoDBKinesisStreamingDestination_Disappears_dynamoDBTable
=== PAUSE TestAccDynamoDBKinesisStreamingDestination_Disappears_dynamoDBTable
=== CONT  TestAccDynamoDBKinesisStreamingDestination_basic
=== CONT  TestAccDynamoDBKinesisStreamingDestination_disappears
=== CONT  TestAccDynamoDBKinesisStreamingDestination_Disappears_dynamoDBTable
--- PASS: TestAccDynamoDBKinesisStreamingDestination_disappears (60.52s)
--- PASS: TestAccDynamoDBKinesisStreamingDestination_basic (61.20s)
--- PASS: TestAccDynamoDBKinesisStreamingDestination_Disappears_dynamoDBTable (66.23s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	76.104s
% make testacc TESTARGS='-run=TestAccDynamoDBTableReplica_' PKG=dynamodb ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/dynamodb/... -v -count 1 -parallel 2  -run=TestAccDynamoDBTableReplica_ -timeout 360m
=== RUN   TestAccDynamoDBTableReplica_basic
=== PAUSE TestAccDynamoDBTableReplica_basic
=== RUN   TestAccDynamoDBTableReplica_disappears
=== PAUSE TestAccDynamoDBTableReplica_disappears
=== RUN   TestAccDynamoDBTableReplica_pitr
=== PAUSE TestAccDynamoDBTableReplica_pitr
=== RUN   TestAccDynamoDBTableReplica_pitrKMS
=== PAUSE TestAccDynamoDBTableReplica_pitrKMS
=== RUN   TestAccDynamoDBTableReplica_pitrDefault
=== PAUSE TestAccDynamoDBTableReplica_pitrDefault
=== RUN   TestAccDynamoDBTableReplica_tags
=== PAUSE TestAccDynamoDBTableReplica_tags
=== RUN   TestAccDynamoDBTableReplica_tableClass
=== PAUSE TestAccDynamoDBTableReplica_tableClass
=== RUN   TestAccDynamoDBTableReplica_keys
=== PAUSE TestAccDynamoDBTableReplica_keys
=== CONT  TestAccDynamoDBTableReplica_basic
=== CONT  TestAccDynamoDBTableReplica_pitrDefault
--- PASS: TestAccDynamoDBTableReplica_basic (193.02s)
=== CONT  TestAccDynamoDBTableReplica_tableClass
--- PASS: TestAccDynamoDBTableReplica_pitrDefault (212.09s)
=== CONT  TestAccDynamoDBTableReplica_keys
--- PASS: TestAccDynamoDBTableReplica_tableClass (498.59s)
=== CONT  TestAccDynamoDBTableReplica_pitr
--- PASS: TestAccDynamoDBTableReplica_keys (494.96s)
=== CONT  TestAccDynamoDBTableReplica_pitrKMS
--- PASS: TestAccDynamoDBTableReplica_pitrKMS (255.85s)
=== CONT  TestAccDynamoDBTableReplica_tags
--- PASS: TestAccDynamoDBTableReplica_pitr (281.19s)
=== CONT  TestAccDynamoDBTableReplica_disappears
--- PASS: TestAccDynamoDBTableReplica_disappears (210.81s)
--- PASS: TestAccDynamoDBTableReplica_tags (353.57s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	1327.115s
% make testacc TESTARGS='-run=TestAccDynamoDBTable_Replica_singleAddCMK\|TestAccDynamoDBTable_Replica_singleCMK' PKG=dynamodb ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/dynamodb/... -v -count 1 -parallel 2  -run=TestAccDynamoDBTable_Replica_singleAddCMK\|TestAccDynamoDBTable_Replica_singleCMK -timeout 360m
=== RUN   TestAccDynamoDBTable_Replica_singleCMK
=== PAUSE TestAccDynamoDBTable_Replica_singleCMK
=== RUN   TestAccDynamoDBTable_Replica_singleAddCMK
=== PAUSE TestAccDynamoDBTable_Replica_singleAddCMK
=== CONT  TestAccDynamoDBTable_Replica_singleCMK
=== CONT  TestAccDynamoDBTable_Replica_singleAddCMK
--- PASS: TestAccDynamoDBTable_Replica_singleAddCMK (511.49s)
--- PASS: TestAccDynamoDBTable_Replica_singleAddCMK (636.69s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	646.844s
@ewbankkit ewbankkit added the eventual-consistency Pertains to eventual consistency issues. label Feb 6, 2024
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 🚀.

% make testacc TESTARGS='-run=TestAccDynamoDBTable_Replica_' PKG=dynamodb ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/dynamodb/... -v -count 1 -parallel 3  -run=TestAccDynamoDBTable_Replica_ -timeout 360m
=== RUN   TestAccDynamoDBTable_Replica_multiple
=== PAUSE TestAccDynamoDBTable_Replica_multiple
=== RUN   TestAccDynamoDBTable_Replica_single
=== PAUSE TestAccDynamoDBTable_Replica_single
=== RUN   TestAccDynamoDBTable_Replica_singleStreamSpecification
=== PAUSE TestAccDynamoDBTable_Replica_singleStreamSpecification
=== RUN   TestAccDynamoDBTable_Replica_singleDefaultKeyEncrypted
=== PAUSE TestAccDynamoDBTable_Replica_singleDefaultKeyEncrypted
=== RUN   TestAccDynamoDBTable_Replica_singleCMK
=== PAUSE TestAccDynamoDBTable_Replica_singleCMK
=== RUN   TestAccDynamoDBTable_Replica_doubleAddCMK
=== PAUSE TestAccDynamoDBTable_Replica_doubleAddCMK
=== RUN   TestAccDynamoDBTable_Replica_pitr
=== PAUSE TestAccDynamoDBTable_Replica_pitr
=== RUN   TestAccDynamoDBTable_Replica_pitrKMS
=== PAUSE TestAccDynamoDBTable_Replica_pitrKMS
=== RUN   TestAccDynamoDBTable_Replica_tagsOneOfTwo
=== PAUSE TestAccDynamoDBTable_Replica_tagsOneOfTwo
=== RUN   TestAccDynamoDBTable_Replica_tagsTwoOfTwo
=== PAUSE TestAccDynamoDBTable_Replica_tagsTwoOfTwo
=== RUN   TestAccDynamoDBTable_Replica_tagsNext
=== PAUSE TestAccDynamoDBTable_Replica_tagsNext
=== RUN   TestAccDynamoDBTable_Replica_tagsUpdate
=== PAUSE TestAccDynamoDBTable_Replica_tagsUpdate
=== CONT  TestAccDynamoDBTable_Replica_multiple
=== CONT  TestAccDynamoDBTable_Replica_pitr
=== CONT  TestAccDynamoDBTable_Replica_tagsTwoOfTwo
--- PASS: TestAccDynamoDBTable_Replica_tagsTwoOfTwo (283.71s)
=== CONT  TestAccDynamoDBTable_Replica_tagsUpdate
--- PASS: TestAccDynamoDBTable_Replica_pitr (324.44s)
=== CONT  TestAccDynamoDBTable_Replica_tagsNext
--- PASS: TestAccDynamoDBTable_Replica_multiple (643.10s)
=== CONT  TestAccDynamoDBTable_Replica_doubleAddCMK
--- PASS: TestAccDynamoDBTable_Replica_tagsUpdate (470.16s)
=== CONT  TestAccDynamoDBTable_Replica_singleStreamSpecification
--- PASS: TestAccDynamoDBTable_Replica_tagsNext (578.28s)
=== CONT  TestAccDynamoDBTable_Replica_single
--- PASS: TestAccDynamoDBTable_Replica_singleStreamSpecification (378.16s)
=== CONT  TestAccDynamoDBTable_Replica_singleCMK
--- PASS: TestAccDynamoDBTable_Replica_singleCMK (238.27s)
=== CONT  TestAccDynamoDBTable_Replica_tagsOneOfTwo
--- PASS: TestAccDynamoDBTable_Replica_single (605.46s)
=== CONT  TestAccDynamoDBTable_Replica_singleDefaultKeyEncrypted
--- PASS: TestAccDynamoDBTable_Replica_doubleAddCMK (990.15s)
=== CONT  TestAccDynamoDBTable_Replica_pitrKMS
--- PASS: TestAccDynamoDBTable_Replica_tagsOneOfTwo (270.87s)
--- PASS: TestAccDynamoDBTable_Replica_singleDefaultKeyEncrypted (213.48s)
--- PASS: TestAccDynamoDBTable_Replica_pitrKMS (374.51s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	2018.900s
% make testacc TESTARGS='-run=TestAccDynamoDBTableReplica_' PKG=dynamodb ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/dynamodb/... -v -count 1 -parallel 2  -run=TestAccDynamoDBTableReplica_ -timeout 360m
=== RUN   TestAccDynamoDBTableReplica_basic
=== PAUSE TestAccDynamoDBTableReplica_basic
=== RUN   TestAccDynamoDBTableReplica_disappears
=== PAUSE TestAccDynamoDBTableReplica_disappears
=== RUN   TestAccDynamoDBTableReplica_pitr
=== PAUSE TestAccDynamoDBTableReplica_pitr
=== RUN   TestAccDynamoDBTableReplica_pitrKMS
=== PAUSE TestAccDynamoDBTableReplica_pitrKMS
=== RUN   TestAccDynamoDBTableReplica_pitrDefault
=== PAUSE TestAccDynamoDBTableReplica_pitrDefault
=== RUN   TestAccDynamoDBTableReplica_tags
=== PAUSE TestAccDynamoDBTableReplica_tags
=== RUN   TestAccDynamoDBTableReplica_tableClass
=== PAUSE TestAccDynamoDBTableReplica_tableClass
=== RUN   TestAccDynamoDBTableReplica_keys
=== PAUSE TestAccDynamoDBTableReplica_keys
=== CONT  TestAccDynamoDBTableReplica_basic
=== CONT  TestAccDynamoDBTableReplica_pitrDefault
--- PASS: TestAccDynamoDBTableReplica_basic (193.02s)
=== CONT  TestAccDynamoDBTableReplica_tableClass
--- PASS: TestAccDynamoDBTableReplica_pitrDefault (212.09s)
=== CONT  TestAccDynamoDBTableReplica_keys
--- PASS: TestAccDynamoDBTableReplica_tableClass (498.59s)
=== CONT  TestAccDynamoDBTableReplica_pitr
--- PASS: TestAccDynamoDBTableReplica_keys (494.96s)
=== CONT  TestAccDynamoDBTableReplica_pitrKMS
--- PASS: TestAccDynamoDBTableReplica_pitrKMS (255.85s)
=== CONT  TestAccDynamoDBTableReplica_tags
--- PASS: TestAccDynamoDBTableReplica_pitr (281.19s)
=== CONT  TestAccDynamoDBTableReplica_disappears
--- PASS: TestAccDynamoDBTableReplica_disappears (210.81s)
--- PASS: TestAccDynamoDBTableReplica_tags (353.57s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	1327.115s
% make testacc TESTARGS='-run=TestAccDynamoDBKinesisStreamingDestination_' PKG=dynamodb
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/dynamodb/... -v -count 1 -parallel 20  -run=TestAccDynamoDBKinesisStreamingDestination_ -timeout 360m
=== RUN   TestAccDynamoDBKinesisStreamingDestination_basic
=== PAUSE TestAccDynamoDBKinesisStreamingDestination_basic
=== RUN   TestAccDynamoDBKinesisStreamingDestination_disappears
=== PAUSE TestAccDynamoDBKinesisStreamingDestination_disappears
=== RUN   TestAccDynamoDBKinesisStreamingDestination_Disappears_dynamoDBTable
=== PAUSE TestAccDynamoDBKinesisStreamingDestination_Disappears_dynamoDBTable
=== CONT  TestAccDynamoDBKinesisStreamingDestination_basic
=== CONT  TestAccDynamoDBKinesisStreamingDestination_disappears
=== CONT  TestAccDynamoDBKinesisStreamingDestination_Disappears_dynamoDBTable
--- PASS: TestAccDynamoDBKinesisStreamingDestination_disappears (60.52s)
--- PASS: TestAccDynamoDBKinesisStreamingDestination_basic (61.20s)
--- PASS: TestAccDynamoDBKinesisStreamingDestination_Disappears_dynamoDBTable (66.23s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	76.104s
% make testacc TESTARGS='-run=TestAccDynamoDBTable_BillingModeGSI_payPerRequestToProvisioned' PKG=dynamodb ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/dynamodb/... -v -count 1 -parallel 2  -run=TestAccDynamoDBTable_BillingModeGSI_payPerRequestToProvisioned -timeout 360m
=== RUN   TestAccDynamoDBTable_BillingModeGSI_payPerRequestToProvisioned
=== PAUSE TestAccDynamoDBTable_BillingModeGSI_payPerRequestToProvisioned
=== CONT  TestAccDynamoDBTable_BillingModeGSI_payPerRequestToProvisioned
--- PASS: TestAccDynamoDBTable_BillingModeGSI_payPerRequestToProvisioned (72.66s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	83.502s
% make testacc TESTARGS='-run=TestAccDynamoDBTable_Disappears_payPerRequestWithGSI' PKG=dynamodb ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/dynamodb/... -v -count 1 -parallel 2  -run=TestAccDynamoDBTable_Disappears_payPerRequestWithGSI -timeout 360m
=== RUN   TestAccDynamoDBTable_Disappears_payPerRequestWithGSI
=== PAUSE TestAccDynamoDBTable_Disappears_payPerRequestWithGSI
=== CONT  TestAccDynamoDBTable_Disappears_payPerRequestWithGSI
--- PASS: TestAccDynamoDBTable_Disappears_payPerRequestWithGSI (90.29s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	101.074s

@ewbankkit
Copy link
Contributor

@szesch Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 21d5ee4 into hashicorp:main Feb 6, 2024
29 checks passed
@github-actions github-actions bot added this to the v5.36.0 milestone Feb 6, 2024
Copy link

github-actions bot commented Feb 8, 2024

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

Copy link

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 Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. eventual-consistency Pertains to eventual consistency issues. service/dynamodb Issues and PRs that pertain to the dynamodb service. size/S Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Incorrectly recreating DynamoDB replicas
2 participants