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 bug with AWS not return KMS key for replica #37570

Merged

Conversation

dobriSu
Copy link

@dobriSu dobriSu commented May 16, 2024

Description

Fix for. Getting empty KMS key for DynamoDB replica bug.

Relations

Closes #37335

References

Output from Acceptance Testing

% make testacc TESTS=TestAccDynamoDBTableReplica_ PKG=dynamodb          
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 test ./internal/service/dynamodb/... -v -count 1 -parallel 20 -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
=== CONT  TestAccDynamoDBTableReplica_tableClass
=== CONT  TestAccDynamoDBTableReplica_pitr
=== CONT  TestAccDynamoDBTableReplica_pitrKMS
=== CONT  TestAccDynamoDBTableReplica_tags
=== CONT  TestAccDynamoDBTableReplica_keys
=== CONT  TestAccDynamoDBTableReplica_disappears
=== NAME  TestAccDynamoDBTableReplica_pitrDefault
    table_replica_test.go:168: Step 1/4 error: Check failed: Check 3/3 error: aws_dynamodb_table_replica.test: Attribute 'kms_key_arn' expected "", got "arn:aws:kms:us-east-1:171364143024:key/79c1cb23-c797-47e9-8897-0d3f384d2403"
--- PASS: TestAccDynamoDBTableReplica_disappears (207.75s)
--- PASS: TestAccDynamoDBTableReplica_basic (208.26s)
--- FAIL: TestAccDynamoDBTableReplica_pitrDefault (244.13s)
--- PASS: TestAccDynamoDBTableReplica_pitr (244.61s)
--- PASS: TestAccDynamoDBTableReplica_pitrKMS (247.12s)
--- PASS: TestAccDynamoDBTableReplica_tableClass (302.84s)
--- PASS: TestAccDynamoDBTableReplica_tags (347.27s)
--- PASS: TestAccDynamoDBTableReplica_keys (450.21s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb   454.638s
FAIL
make: *** [testacc] Error 1

...

…table.SSEDescription.KMSMasterKeyArn != nil
Copy link

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.

@dobriSu dobriSu changed the title Set names.AttrKMSKeyARN with table.SSEDescription.KMSMasterKeyArn if … Set names.AttrKMSKeyARN with table.SSEDescription.KMSMasterKeyArn if table.SSEDescription.KMSMasterKeyArn != nil May 16, 2024
@github-actions github-actions bot added size/XS Managed by automation to categorize the size of a PR. service/dynamodb Issues and PRs that pertain to the dynamodb service. labels May 16, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 16, 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 @dobriSu 👋

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

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels May 16, 2024
@dobriSu dobriSu changed the title Set names.AttrKMSKeyARN with table.SSEDescription.KMSMasterKeyArn if table.SSEDescription.KMSMasterKeyArn != nil Fix bug with AWS not return KMS key for replica May 17, 2024
@github-actions github-actions bot added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label May 17, 2024
@dobriSu
Copy link
Author

dobriSu commented May 17, 2024

Hi @YakDriver could you please take a look?
I am concerned that it might broke your PR:
#29102

@dobriSu dobriSu force-pushed the b-fix_dynamo_db_replica_import_kms_key branch from 3d99cf6 to 80a81a3 Compare May 17, 2024 22:45
@ewbankkit ewbankkit self-assigned this May 20, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label May 20, 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=TestAccDynamoDBTableReplica_' PKG=dynamodb ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.2 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 (195.00s)
=== CONT  TestAccDynamoDBTableReplica_tableClass
--- PASS: TestAccDynamoDBTableReplica_pitrDefault (268.62s)
=== CONT  TestAccDynamoDBTableReplica_keys
--- PASS: TestAccDynamoDBTableReplica_keys (355.45s)
=== CONT  TestAccDynamoDBTableReplica_tags
--- PASS: TestAccDynamoDBTableReplica_tableClass (501.58s)
=== CONT  TestAccDynamoDBTableReplica_pitr
--- PASS: TestAccDynamoDBTableReplica_tags (244.28s)
=== CONT  TestAccDynamoDBTableReplica_pitrKMS
--- PASS: TestAccDynamoDBTableReplica_pitr (227.69s)
=== CONT  TestAccDynamoDBTableReplica_disappears
--- PASS: TestAccDynamoDBTableReplica_pitrKMS (255.47s)
--- PASS: TestAccDynamoDBTableReplica_disappears (229.74s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	1158.480s

@ewbankkit
Copy link
Contributor

@dobriSu Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 9330cf6 into hashicorp:main May 20, 2024
36 checks passed
@github-actions github-actions bot added this to the v5.51.0 milestone May 20, 2024
@dobriSu dobriSu deleted the b-fix_dynamo_db_replica_import_kms_key branch May 21, 2024 18:19
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label May 24, 2024
Copy link

This functionality has been released in v5.51.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
bug Addresses a defect in current functionality. service/dynamodb Issues and PRs that pertain to the dynamodb service. size/XS 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.

[Bug]: Getting empty KMS key for DynamoDB replica
3 participants