-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
add resource aws kms policy attachment #29923
add resource aws kms policy attachment #29923
Conversation
…cy_attachment resource
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One clarification about sharing the updateKeyPolicy() method.
LGTM otherwise 🚀
…key_policy_attachment resource" This reverts commit 0a13a11.
4c6b615
to
70b8996
Compare
There was a problem hiding this 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=TestAccKMSKeyPolicy_\|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=TestAccKMSKeyPolicy_\|TestAccKMSKey_ -timeout 180m
=== 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 TestAccKMSKeyPolicy_basic
=== CONT TestAccKMSKey_asymmetricKey
--- PASS: TestAccKMSKey_asymmetricKey (21.31s)
=== CONT TestAccKMSKeyPolicy_iamRoleOrder
--- PASS: TestAccKMSKeyPolicy_basic (61.57s)
=== CONT TestAccKMSKey_multiRegion
--- PASS: TestAccKMSKey_multiRegion (25.12s)
=== CONT TestAccKMSKey_disappears
--- PASS: TestAccKMSKeyPolicy_iamRoleOrder (80.57s)
=== CONT TestAccKMSKey_basic
--- PASS: TestAccKMSKey_disappears (17.79s)
=== CONT TestAccKMSKeyPolicy_booleanCondition
--- PASS: TestAccKMSKey_basic (23.50s)
=== CONT TestAccKMSKeyPolicy_iamServiceLinkedRole
--- PASS: TestAccKMSKeyPolicy_booleanCondition (28.86s)
=== CONT TestAccKMSKey_Policy_iamRoleUpdate
--- PASS: TestAccKMSKey_Policy_iamRoleUpdate (50.63s)
=== CONT TestAccKMSKey_tags
--- PASS: TestAccKMSKeyPolicy_iamServiceLinkedRole (59.78s)
=== CONT TestAccKMSKey_isEnabled
--- PASS: TestAccKMSKey_tags (63.67s)
=== CONT TestAccKMSKey_Policy_booleanCondition
--- PASS: TestAccKMSKey_Policy_booleanCondition (22.00s)
=== CONT TestAccKMSKey_Policy_iamServiceLinkedRole
--- PASS: TestAccKMSKey_isEnabled (120.95s)
=== CONT TestAccKMSKey_Policy_iamRoleOrder
--- PASS: TestAccKMSKey_Policy_iamServiceLinkedRole (63.23s)
=== CONT TestAccKMSKeyPolicy_keyIsEnabled
--- PASS: TestAccKMSKey_Policy_iamRoleOrder (67.10s)
=== CONT TestAccKMSKeyPolicy_iamRoleUpdate
--- PASS: TestAccKMSKeyPolicy_keyIsEnabled (72.22s)
=== CONT TestAccKMSKeyPolicy_iamRole
--- PASS: TestAccKMSKeyPolicy_iamRoleUpdate (73.76s)
=== CONT TestAccKMSKey_Policy_bypass
--- PASS: TestAccKMSKeyPolicy_iamRole (46.55s)
=== CONT TestAccKMSKey_Policy_iamRole
--- PASS: TestAccKMSKey_Policy_iamRole (42.22s)
=== CONT TestAccKMSKey_Policy_bypassUpdate
--- PASS: TestAccKMSKey_Policy_bypassUpdate (36.25s)
=== CONT TestAccKMSKey_Policy_basic
--- PASS: TestAccKMSKey_Policy_basic (32.77s)
=== CONT TestAccKMSKeyPolicy_bypass
--- PASS: TestAccKMSKey_Policy_bypass (146.22s)
=== CONT TestAccKMSKeyPolicy_bypassUpdate
--- PASS: TestAccKMSKeyPolicy_bypassUpdate (34.47s)
=== CONT TestAccKMSKeyPolicy_disappears
--- PASS: TestAccKMSKeyPolicy_disappears (15.95s)
=== CONT TestAccKMSKey_hmacKey
--- PASS: TestAccKMSKey_hmacKey (12.89s)
--- PASS: TestAccKMSKeyPolicy_bypass (145.43s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/kms 721.687s
@silvaalbert Thanks for the contribution 🎉 👏. |
This functionality has been released in v4.59.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! |
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. |
Description
This PR adds an
aws_kms_key_policy_attachment
resource, while deprecating thepolicy
attribute inaws_kms_key
.aws_kms_key
tests were modified for least privilege, as several usedPrincipal":{"AWS":"*"}
unnecessarily.Relations
Closes #464
References
https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html
Output from Acceptance Testing
aws_kms_key_policy_attachment
aws_kms_key