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 #12555: Error "grant not found for key id" #12560

Merged
merged 3 commits into from
Apr 1, 2020
Merged

Fix #12555: Error "grant not found for key id" #12560

merged 3 commits into from
Apr 1, 2020

Conversation

dshkyra
Copy link
Contributor

@dshkyra dshkyra commented Mar 27, 2020

When a KMS grant was not found, terraform apply failed during
refreshing state with an error "grant not found for key id".

Now, when a KMS grant is not found, it is treated as revoked and
terraform shows the change in the plan and recreates it during apply.

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #12555

Release note for CHANGELOG:

resource/aws_kms_grant: Fix error "grant not found for key id" during terraform apply during refreshing state

Output from acceptance testing:

$ make testacc TEST=./aws TESTARGS='-run=TestAccAWSKmsGrant'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSKmsGrant -timeout 120m
...
--- PASS: TestAccAWSKmsGrant_ARN (38.75s)
--- PASS: TestAccAWSKmsGrant_Basic (39.18s)
--- PASS: TestAccAWSKmsGrant_withRetiringPrincipal (39.32s)
--- PASS: TestAccAWSKmsGrant_bare (40.15s)
--- PASS: TestAccAWSKmsGrant_withConstraints (46.74s)
--- PASS: TestAccAWSKmsGrant_disappears (219.23s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	220.491s

When a KMS grant was not found, terraform apply failed during
refreshing state with an error "grant not found for key id".

Now, when a KMS grant is not found, it is treated as revoked and
terraform shows the change in the plan and recreates it during apply.
@dshkyra dshkyra requested a review from a team March 27, 2020 21:36
@ghost ghost added size/S Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/kms Issues and PRs that pertain to the kms service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Mar 27, 2020
@bflad
Copy link
Contributor

bflad commented Mar 30, 2020

☝️ Fixed simple merge conflict since we just merged another PR affecting that file.

@bflad bflad added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 30, 2020
@bflad bflad self-assigned this Mar 30, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Hi @dshkyra 👋 This looks really good, just needs updates for the testing due to #11991 being merged. Once those are in, we'll merge this in. Thanks!

@dshkyra
Copy link
Contributor Author

dshkyra commented Mar 30, 2020

@bflad thanks for your comments. I've updated the PR and re-run integration tests ✅.

@dshkyra dshkyra requested a review from bflad March 30, 2020 17:35
@bflad bflad added this to the v2.56.0 milestone Apr 1, 2020
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @dshkyra for the update and of course the fix! 🚀

Output from acceptance testing:

--- PASS: TestAccAWSKmsGrant_Basic (36.00s)
--- PASS: TestAccAWSKmsGrant_ARN (43.76s)
--- PASS: TestAccAWSKmsGrant_bare (44.22s)
--- PASS: TestAccAWSKmsGrant_withRetiringPrincipal (44.30s)
--- PASS: TestAccAWSKmsGrant_withConstraints (50.11s)
--- PASS: TestAccAWSKmsGrant_disappears (233.92s)

@bflad bflad merged commit a836c89 into hashicorp:master Apr 1, 2020
bflad added a commit that referenced this pull request Apr 1, 2020
@ghost
Copy link

ghost commented Apr 3, 2020

This has been released in version 2.56.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 for triage. Thanks!

@ghost
Copy link

ghost commented May 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators May 1, 2020
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. service/kms Issues and PRs that pertain to the kms service. size/S 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.

aws_kms_grant: Error "grant not found for key id" during terraform apply on refresh state
2 participants