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

r/aws_kms_key: Fix tag propagation timeout errors when ignore_tags is configured #33167

Merged
merged 15 commits into from
Aug 24, 2023

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Aug 23, 2023

Description

Fixes tag propagation: timeout while waiting for state to become 'TRUE' errors when ignore_tags has been configured.

Relations

Closes #26174.
Relates #33154.

Output from Acceptance Testing

Previously
% make testacc TESTARGS='-run=TestAccKMSKey_ignoreTags' PKG=kms
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20  -run=TestAccKMSKey_ignoreTags -timeout 180m
=== RUN   TestAccKMSKey_ignoreTags
=== PAUSE TestAccKMSKey_ignoreTags
=== CONT  TestAccKMSKey_ignoreTags
    key_test.go:526: Step 3/3 error: Error running apply: exit status 1
        
        Error: updating tags for KMS (Key Management) Key (89404ac1-aaeb-4879-a58f-c233fdfaa9ec): waiting for resource (89404ac1-aaeb-4879-a58f-c233fdfaa9ec) 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 13, in resource "aws_kms_key" "test":
          13: resource "aws_kms_key" "test" {
        
--- FAIL: TestAccKMSKey_ignoreTags (686.51s)
FAIL
FAIL	github.com/hashicorp/terraform-provider-aws/internal/service/kms	692.089s
FAIL
make: *** [testacc] Error 1
% make testacc TESTARGS='-run=TestAccKMSKey_' PKG=kms ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 3  -run=TestAccKMSKey_ -timeout 180m
=== 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
=== RUN   TestAccKMSKey_ignoreTags
=== PAUSE TestAccKMSKey_ignoreTags
=== CONT  TestAccKMSKey_basic
=== CONT  TestAccKMSKey_ignoreTags
=== CONT  TestAccKMSKey_Policy_iamRole
--- PASS: TestAccKMSKey_basic (81.05s)
=== CONT  TestAccKMSKey_hmacKey
--- PASS: TestAccKMSKey_Policy_iamRole (83.47s)
=== CONT  TestAccKMSKey_Policy_bypassUpdate
--- PASS: TestAccKMSKey_ignoreTags (122.25s)
=== CONT  TestAccKMSKey_Policy_bypass
--- PASS: TestAccKMSKey_hmacKey (44.54s)
=== CONT  TestAccKMSKey_Policy_basic
--- PASS: TestAccKMSKey_Policy_bypassUpdate (79.15s)
=== CONT  TestAccKMSKey_multiRegion
--- PASS: TestAccKMSKey_Policy_basic (75.45s)
=== CONT  TestAccKMSKey_asymmetricKey
--- PASS: TestAccKMSKey_multiRegion (44.84s)
=== CONT  TestAccKMSKey_Policy_booleanCondition
--- PASS: TestAccKMSKey_asymmetricKey (37.93s)
=== CONT  TestAccKMSKey_tags
--- PASS: TestAccKMSKey_Policy_booleanCondition (43.02s)
=== CONT  TestAccKMSKey_isEnabled
--- PASS: TestAccKMSKey_Policy_bypass (186.74s)
=== CONT  TestAccKMSKey_disappears
--- PASS: TestAccKMSKey_disappears (34.89s)
=== CONT  TestAccKMSKey_Policy_iamRoleOrder
--- PASS: TestAccKMSKey_tags (180.34s)
=== CONT  TestAccKMSKey_Policy_iamServiceLinkedRole
--- PASS: TestAccKMSKey_isEnabled (187.08s)
=== CONT  TestAccKMSKey_Policy_iamRoleUpdate
--- PASS: TestAccKMSKey_Policy_iamRoleOrder (136.97s)
--- PASS: TestAccKMSKey_Policy_iamServiceLinkedRole (72.67s)
--- PASS: TestAccKMSKey_Policy_iamRoleUpdate (86.40s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/kms	530.142s

@github-actions
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.

@github-actions github-actions bot added size/L 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 Aug 23, 2023
@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 Aug 23, 2023
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 🎉

% make testacc PKG=kms TESTS=TestAccKMSKey_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20 -run='TestAccKMSKey_'  -timeout 180m

--- PASS: TestAccKMSKey_disappears (39.37s)
--- PASS: TestAccKMSKey_asymmetricKey (42.41s)
--- PASS: TestAccKMSKey_hmacKey (44.89s)
--- PASS: TestAccKMSKey_Policy_booleanCondition (50.74s)
--- PASS: TestAccKMSKey_multiRegion (51.48s)
--- PASS: TestAccKMSKey_Policy_iamRole (64.57s)
--- PASS: TestAccKMSKey_Policy_basic (80.05s)
--- PASS: TestAccKMSKey_Policy_bypassUpdate (80.10s)
--- PASS: TestAccKMSKey_basic (80.61s)
--- PASS: TestAccKMSKey_Policy_iamServiceLinkedRole (88.82s)
--- PASS: TestAccKMSKey_Policy_iamRoleUpdate (93.16s)
--- PASS: TestAccKMSKey_ignoreTags (112.23s)
--- PASS: TestAccKMSKey_Policy_iamRoleOrder (113.01s)
--- PASS: TestAccKMSKey_tags (151.04s)
--- PASS: TestAccKMSKey_isEnabled (172.14s)
--- PASS: TestAccKMSKey_Policy_bypass (175.16s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/kms        178.769s

@ewbankkit ewbankkit merged commit b8b8d2c into main Aug 24, 2023
36 checks passed
@ewbankkit ewbankkit deleted the b-aws_kms_key-tag-update-timeout branch August 24, 2023 13:22
@github-actions github-actions bot added this to the v5.14.0 milestone Aug 24, 2023
github-actions bot pushed a commit that referenced this pull request Aug 24, 2023
@github-actions
Copy link

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

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 Sep 24, 2023
@justinretzolk justinretzolk added the bug Addresses a defect in current functionality. label Feb 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. generators Relates to code generators. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/kms Issues and PRs that pertain to the kms service. size/L 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.

Error waiting for KMS Key tag propagation: timeout while waiting for state to become 'TRUE' -- KMS tag bug
3 participants