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

KMS Keys: Fixes timeout when removing all tags #32371

Merged
merged 2 commits into from
Jul 5, 2023
Merged

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Jul 4, 2023

Description

Fixes timeout error when removing all tags from

  • aws_kms_key
  • aws_kms_external_key
  • aws_kms_replica_external_key
  • aws_kms_replica_key

Output from Acceptance Testing

$ make testacc PKG=kms TESTS=TestAccKMSKey

--- PASS: TestAccKMSKey_disappears (107.03s)
--- PASS: TestAccKMSKeyDataSource_byKeyARN (115.68s)
--- PASS: TestAccKMSKeyPolicy_disappears (120.03s)
--- PASS: TestAccKMSKey_hmacKey (127.22s)
--- PASS: TestAccKMSKey_asymmetricKey (130.71s)
--- PASS: TestAccKMSKey_Policy_booleanCondition (140.26s)
--- PASS: TestAccKMSKey_basic (152.11s)
--- PASS: TestAccKMSKey_multiRegion (152.28s)
--- PASS: TestAccKMSKeyPolicy_booleanCondition (156.69s)
--- PASS: TestAccKMSKey_Policy_iamRole (201.02s)
--- PASS: TestAccKMSKey_Policy_iamServiceLinkedRole (201.08s)
--- PASS: TestAccKMSKeyPolicy_iamServiceLinkedRole (211.75s)
--- PASS: TestAccKMSKey_Policy_bypassUpdate (267.76s)
--- PASS: TestAccKMSKey_Policy_basic (279.99s)
--- PASS: TestAccKMSKey_Policy_iamRoleUpdate (287.37s)
--- PASS: TestAccKMSKeyDataSource_multiRegionConfigurationByID (143.72s)
--- PASS: TestAccKMSKeyDataSource_grantToken (162.89s)
--- PASS: TestAccKMSKeyDataSource_multiRegionConfigurationByARN (150.21s)
--- PASS: TestAccKMSKeyPolicy_iamRole (202.09s)
--- PASS: TestAccKMSKeyDataSource_byAliasARN (118.89s)
--- PASS: TestAccKMSKeyDataSource_byAliasID (119.11s)
--- PASS: TestAccKMSKey_Policy_bypass (322.10s)
--- PASS: TestAccKMSKeyDataSource_byKeyID (114.17s)
--- PASS: TestAccKMSKey_Policy_iamRoleOrder (345.79s)
--- PASS: TestAccKMSKeyPolicy_bypassUpdate (222.43s)
--- PASS: TestAccKMSKeyPolicy_iamRoleUpdate (244.52s)
--- PASS: TestAccKMSKeyPolicy_iamRoleOrder (351.56s)
--- PASS: TestAccKMSKeyPolicy_keyIsEnabled (244.08s)
--- PASS: TestAccKMSKeyPolicy_basic (213.69s)
--- PASS: TestAccKMSKeyPolicy_bypass (243.15s)
--- PASS: TestAccKMSKey_isEnabled (378.11s)
--- PASS: TestAccKMSKey_tags (385.73s)

@github-actions
Copy link

github-actions bot commented Jul 4, 2023

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 size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/kms Issues and PRs that pertain to the kms service. tags Pertains to resource tagging. generators Relates to code generators. labels Jul 4, 2023
@ewbankkit
Copy link
Contributor

Not a blocker for this PR, but we need to tidy up the generate/tags README(s) (internal/generate/tags/README.md etc.).

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=TestAccKMSKey' PKG=kms ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 2  -run=TestAccKMSKey -timeout 180m
=== RUN   TestAccKMSKeyDataSource_byKeyARN
=== PAUSE TestAccKMSKeyDataSource_byKeyARN
=== RUN   TestAccKMSKeyDataSource_byKeyID
=== PAUSE TestAccKMSKeyDataSource_byKeyID
=== RUN   TestAccKMSKeyDataSource_byAliasARN
=== PAUSE TestAccKMSKeyDataSource_byAliasARN
=== RUN   TestAccKMSKeyDataSource_byAliasID
=== PAUSE TestAccKMSKeyDataSource_byAliasID
=== RUN   TestAccKMSKeyDataSource_grantToken
=== PAUSE TestAccKMSKeyDataSource_grantToken
=== RUN   TestAccKMSKeyDataSource_multiRegionConfigurationByARN
=== PAUSE TestAccKMSKeyDataSource_multiRegionConfigurationByARN
=== RUN   TestAccKMSKeyDataSource_multiRegionConfigurationByID
=== PAUSE TestAccKMSKeyDataSource_multiRegionConfigurationByID
=== RUN   TestAccKMSKeyPolicy_basic
=== PAUSE TestAccKMSKeyPolicy_basic
=== RUN   TestAccKMSKeyPolicy_disappears
=== PAUSE TestAccKMSKeyPolicy_disappears
=== RUN   TestAccKMSKeyPolicy_bypass
=== PAUSE TestAccKMSKeyPolicy_bypass
=== RUN   TestAccKMSKeyPolicy_bypassUpdate
=== PAUSE TestAccKMSKeyPolicy_bypassUpdate
=== RUN   TestAccKMSKeyPolicy_keyIsEnabled
=== PAUSE TestAccKMSKeyPolicy_keyIsEnabled
=== RUN   TestAccKMSKeyPolicy_iamRole
=== PAUSE TestAccKMSKeyPolicy_iamRole
=== RUN   TestAccKMSKeyPolicy_iamRoleUpdate
=== PAUSE TestAccKMSKeyPolicy_iamRoleUpdate
=== RUN   TestAccKMSKeyPolicy_iamRoleOrder
=== PAUSE TestAccKMSKeyPolicy_iamRoleOrder
=== RUN   TestAccKMSKeyPolicy_iamServiceLinkedRole
=== PAUSE TestAccKMSKeyPolicy_iamServiceLinkedRole
=== RUN   TestAccKMSKeyPolicy_booleanCondition
=== PAUSE TestAccKMSKeyPolicy_booleanCondition
=== RUN   TestAccKMSKey_basic
=== PAUSE TestAccKMSKey_basic
=== RUN   TestAccKMSKey_disappears
=== PAUSE TestAccKMSKey_disappears
=== RUN   TestAccKMSKey_multiRegion
=== PAUSE TestAccKMSKey_multiRegion
=== RUN   TestAccKMSKey_asymmetricKey
=== PAUSE TestAccKMSKey_asymmetricKey
=== RUN   TestAccKMSKey_hmacKey
=== PAUSE TestAccKMSKey_hmacKey
=== RUN   TestAccKMSKey_Policy_basic
=== PAUSE TestAccKMSKey_Policy_basic
=== RUN   TestAccKMSKey_Policy_bypass
=== PAUSE TestAccKMSKey_Policy_bypass
=== RUN   TestAccKMSKey_Policy_bypassUpdate
=== PAUSE TestAccKMSKey_Policy_bypassUpdate
=== RUN   TestAccKMSKey_Policy_iamRole
=== PAUSE TestAccKMSKey_Policy_iamRole
=== RUN   TestAccKMSKey_Policy_iamRoleUpdate
=== PAUSE TestAccKMSKey_Policy_iamRoleUpdate
=== RUN   TestAccKMSKey_Policy_iamRoleOrder
=== PAUSE TestAccKMSKey_Policy_iamRoleOrder
=== RUN   TestAccKMSKey_Policy_iamServiceLinkedRole
=== PAUSE TestAccKMSKey_Policy_iamServiceLinkedRole
=== RUN   TestAccKMSKey_Policy_booleanCondition
=== PAUSE TestAccKMSKey_Policy_booleanCondition
=== RUN   TestAccKMSKey_isEnabled
=== PAUSE TestAccKMSKey_isEnabled
=== RUN   TestAccKMSKey_tags
=== PAUSE TestAccKMSKey_tags
=== CONT  TestAccKMSKeyDataSource_byKeyARN
=== CONT  TestAccKMSKeyPolicy_booleanCondition
=== CONT  TestAccKMSKeyPolicy_disappears
--- PASS: TestAccKMSKeyDataSource_byKeyARN (28.68s)
--- PASS: TestAccKMSKeyPolicy_booleanCondition (37.50s)
=== CONT  TestAccKMSKeyPolicy_iamServiceLinkedRole
--- PASS: TestAccKMSKeyPolicy_disappears (23.88s)
=== CONT  TestAccKMSKeyPolicy_iamRoleOrder
--- PASS: TestAccKMSKeyPolicy_iamServiceLinkedRole (61.74s)
=== CONT  TestAccKMSKeyPolicy_iamRoleUpdate
--- PASS: TestAccKMSKeyPolicy_iamRoleOrder (84.39s)
=== CONT  TestAccKMSKeyPolicy_iamRole
--- PASS: TestAccKMSKeyPolicy_iamRoleUpdate (62.62s)
=== CONT  TestAccKMSKeyPolicy_keyIsEnabled
--- PASS: TestAccKMSKeyPolicy_iamRole (43.62s)
=== CONT  TestAccKMSKeyPolicy_bypassUpdate
--- PASS: TestAccKMSKeyPolicy_bypassUpdate (48.89s)
=== CONT  TestAccKMSKeyPolicy_bypass
--- PASS: TestAccKMSKeyPolicy_keyIsEnabled (80.92s)
=== CONT  TestAccKMSKey_Policy_bypassUpdate
--- PASS: TestAccKMSKey_Policy_bypassUpdate (43.55s)
=== CONT  TestAccKMSKey_tags
--- PASS: TestAccKMSKeyPolicy_bypass (157.89s)
=== CONT  TestAccKMSKey_isEnabled
--- PASS: TestAccKMSKey_isEnabled (129.21s)
=== CONT  TestAccKMSKey_Policy_booleanCondition
--- PASS: TestAccKMSKey_Policy_booleanCondition (25.66s)
=== CONT  TestAccKMSKey_Policy_iamServiceLinkedRole
--- PASS: TestAccKMSKey_Policy_iamServiceLinkedRole (55.26s)
=== CONT  TestAccKMSKey_Policy_iamRoleOrder
--- PASS: TestAccKMSKey_Policy_iamRoleOrder (76.38s)
=== CONT  TestAccKMSKey_Policy_iamRoleUpdate
--- PASS: TestAccKMSKey_Policy_iamRoleUpdate (74.20s)
=== CONT  TestAccKMSKey_Policy_iamRole
--- PASS: TestAccKMSKey_Policy_iamRole (57.82s)
=== CONT  TestAccKMSKey_asymmetricKey
--- PASS: TestAccKMSKey_asymmetricKey (21.41s)
=== CONT  TestAccKMSKey_Policy_bypass
=== NAME  TestAccKMSKey_tags
    key_test.go:458: Step 5/6 error: Error running apply: exit status 1
        
        Error: updating tags for KMS (Key Management) Key (4985aa0e-541b-4ee8-9532-eb7fdd6d5d8a): waiting for resource (4985aa0e-541b-4ee8-9532-eb7fdd6d5d8a) tag propagation: timeout while waiting for state to become 'TRUE' (last state: 'FALSE', timeout: 10m0s)
        
          with aws_kms_key.test,
          on terraform_plugin_test.tf line 2, in resource "aws_kms_key" "test":
           2: resource "aws_kms_key" "test" {
        
--- FAIL: TestAccKMSKey_tags (678.72s)
=== CONT  TestAccKMSKey_Policy_basic
--- PASS: TestAccKMSKey_Policy_bypass (156.92s)
=== CONT  TestAccKMSKey_hmacKey
--- PASS: TestAccKMSKey_hmacKey (22.49s)
=== CONT  TestAccKMSKeyDataSource_grantToken
--- PASS: TestAccKMSKey_Policy_basic (46.14s)
=== CONT  TestAccKMSKeyPolicy_basic
--- PASS: TestAccKMSKeyDataSource_grantToken (40.58s)
=== CONT  TestAccKMSKeyDataSource_multiRegionConfigurationByID
--- PASS: TestAccKMSKeyDataSource_multiRegionConfigurationByID (26.49s)
=== CONT  TestAccKMSKeyDataSource_multiRegionConfigurationByARN
--- PASS: TestAccKMSKeyPolicy_basic (66.89s)
=== CONT  TestAccKMSKey_disappears
--- PASS: TestAccKMSKeyDataSource_multiRegionConfigurationByARN (23.67s)
=== CONT  TestAccKMSKey_basic
--- PASS: TestAccKMSKey_disappears (19.96s)
=== CONT  TestAccKMSKeyDataSource_byAliasARN
--- PASS: TestAccKMSKeyDataSource_byAliasARN (23.56s)
=== CONT  TestAccKMSKeyDataSource_byAliasID
--- PASS: TestAccKMSKey_basic (27.28s)
=== CONT  TestAccKMSKeyDataSource_byKeyID
--- PASS: TestAccKMSKeyDataSource_byAliasID (24.07s)
=== CONT  TestAccKMSKey_multiRegion
--- PASS: TestAccKMSKeyDataSource_byKeyID (23.30s)
--- PASS: TestAccKMSKey_multiRegion (26.07s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/kms	1177.448s
FAIL
make: *** [testacc] Error 1
% make testacc TESTARGS='-run=TestAccKMSKey_tags' PKG=kms ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 2  -run=TestAccKMSKey_tags -timeout 180m
=== RUN   TestAccKMSKey_tags
=== PAUSE TestAccKMSKey_tags
=== CONT  TestAccKMSKey_tags
--- PASS: TestAccKMSKey_tags (97.04s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kms	102.353s

@gdavison gdavison merged commit e3a40d0 into main Jul 5, 2023
@gdavison gdavison deleted the b-kms-key-remove-tags branch July 5, 2023 18:33
@github-actions github-actions bot added this to the v5.7.0 milestone Jul 5, 2023
github-actions bot pushed a commit that referenced this pull request Jul 5, 2023
@github-actions
Copy link

github-actions bot commented Jul 7, 2023

This functionality has been released in v5.7.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 Aug 7, 2023

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 Aug 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
generators Relates to code generators. service/kms Issues and PRs that pertain to the kms service. size/XL Managed by automation to categorize the size of a PR. tags Pertains to resource tagging. 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