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

Allow usage of service principals for KMS grants #32595

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

nam054
Copy link
Contributor

@nam054 nam054 commented Jul 19, 2023

Description

Allow usage of service principals for KMS grants

Relations

Relates #25360

Output from Acceptance Testing

--- PASS: TestAccKMSGrant_service (22.83s)
--- PASS: TestAccKMSGrant_arn (33.14s)
--- PASS: TestAccKMSGrant_basic (33.30s)
--- PASS: TestAccKMSGrant_bare (40.71s)
--- PASS: TestAccKMSGrant_withRetiringPrincipal (41.12s)
--- PASS: TestAccKMSGrant_asymmetricKey (41.21s)
--- PASS: TestAccKMSGrant_withConstraints (53.18s)
--- PASS: TestAccKMSGrant_disappears (209.00s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/kms        212.279s
...

@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/M 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. verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.) and removed size/M Managed by automation to categorize the size of a PR. labels Jul 19, 2023
@nam054 nam054 force-pushed the f-service-principals-for-kms branch from 04eb68b to 0a915ba Compare July 20, 2023 19:33
@github-actions github-actions bot added the size/M Managed by automation to categorize the size of a PR. label Jul 20, 2023
@nam054 nam054 marked this pull request as ready for review July 20, 2023 20:15
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 🎉

$ go test -v -count=1 ./internal/verify/... | rg "\-\-\-"
--- PASS: TestBase64Encode (0.00s)
--- PASS: TestValidAccountID (0.00s)
--- PASS: TestValidTypeStringNullableFloat (0.00s)
--- PASS: TestValidARN (0.00s)
--- PASS: TestValid4ByteASNString (0.00s)
--- PASS: TestJSONBytesEqualQuotedAndUnquoted (0.00s)
--- PASS: TestValidAmazonSideASN (0.00s)
--- PASS: TestJSONBytesEqualWhitespaceAndNoWhitespace (0.00s)
--- PASS: TestDiffStringMaps (0.00s)
--- PASS: TestSemVerLessThan (0.00s)
--- PASS: TestLooksLikeJSONString (0.00s)
--- PASS: TestValidServicePrincipal (0.00s)
--- PASS: TestNormalizeJSONOrYAMLString (0.00s)
--- PASS: TestSuppressEquivalentJSONDiffsWhitespaceAndNoWhitespace (0.00s)
--- PASS: TestSemVerGreaterThanOrEqual (0.00s)
--- PASS: TestFloatGreaterThan (0.00s)
--- PASS: TestValidLaunchTemplateID (0.00s)
--- PASS: TestValidUTCTimestamp (0.00s)
--- PASS: TestValidLaunchTemplateName (0.00s)
--- PASS: TestValidStringIsJSONOrYAML (0.00s)
--- PASS: TestSuppressEquivalentJSONOrYAMLDiffs (0.00s)
--- PASS: TestValidCIDRNetworkAddress (0.00s)
--- PASS: TestValidIPv6CIDRBlock (0.00s)
--- PASS: TestValidateTypeStringIsDateOrInt (0.00s)
--- PASS: TestValidOnceADayWindowFormat (0.00s)
--- PASS: TestValidIPv4CIDRBlock (0.00s)
--- PASS: TestCheckYAMLString (0.00s)
--- PASS: TestSecondJSONUnlessEquivalent (0.00s)
--- PASS: TestSuppressEquivalentRoundedTime (0.00s)
--- PASS: TestIsIPv4CIDRBlockOrIPv6CIDRBlock (0.00s)
--- PASS: TestValidOnceAWeekWindowFormat (0.00s)
--- PASS: TestValidIAMPolicyJSONString (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/{} (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/#00 (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/[{}] (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/"../some-filename.json" (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/"{\"Version\":\"...\"}" (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/"blub" (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/{"xyz":[}} (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/____{"xyz":_"foo"} (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/{"def":} (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/{0:"1"} (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/{"abc":["1","2"]} (0.00s)
    --- PASS: TestValidIAMPolicyJSONString/{'abc':1} (0.00s)
--- PASS: TestLegacyPolicyNormalize (0.00s)
    --- PASS: TestLegacyPolicyNormalize/basic (0.00s)
    --- PASS: TestLegacyPolicyNormalize/newOrder (0.00s)
    --- PASS: TestLegacyPolicyNormalize/complex1 (0.00s)
    --- PASS: TestLegacyPolicyNormalize/id (0.00s)
    --- PASS: TestLegacyPolicyNormalize/principal (0.00s)
    --- PASS: TestLegacyPolicyNormalize/normalWhitespace (0.00s)
    --- PASS: TestLegacyPolicyNormalize/complex2 (0.00s)
    --- PASS: TestLegacyPolicyNormalize/badJSON (0.00s)
$ make testacc PKG=kms TESTS=TestAccKMSGrant_
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20 -run='TestAccKMSGrant_'  -timeout 180m

=== NAME  TestAccKMSGrant_crossAccountARN
    acctest.go:803: skipping test because at least one environment variable of [AWS_ALTERNATE_PROFILE AWS_ALTERNATE_ACCESS_KEY_ID] must be set. Usage: credentials for running acceptance testing in alternate AWS account.
--- SKIP: TestAccKMSGrant_crossAccountARN (0.41s)
--- PASS: TestAccKMSGrant_service (24.26s)
--- PASS: TestAccKMSGrant_arn (34.84s)
--- PASS: TestAccKMSGrant_asymmetricKey (34.93s)
--- PASS: TestAccKMSGrant_bare (35.59s)
--- PASS: TestAccKMSGrant_basic (35.73s)
--- PASS: TestAccKMSGrant_withRetiringPrincipal (35.77s)
--- PASS: TestAccKMSGrant_withConstraints (48.50s)
--- PASS: TestAccKMSGrant_disappears (210.56s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/kms        213.868s

@jar-b
Copy link
Member

jar-b commented Jul 21, 2023

Forgot to mention in the review, but just needs a changelog.

@breathingdust breathingdust added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jul 21, 2023
@nam054 nam054 force-pushed the f-service-principals-for-kms branch from 0a915ba to 6bb27c4 Compare July 21, 2023 19:51
@nam054 nam054 merged commit 9a53ff9 into main Jul 21, 2023
@nam054 nam054 deleted the f-service-principals-for-kms branch July 21, 2023 21:52
@github-actions github-actions bot added this to the v5.10.0 milestone Jul 21, 2023
github-actions bot pushed a commit that referenced this pull request Jul 21, 2023
@github-actions
Copy link

This functionality has been released in v5.10.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 Aug 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. verify Pertains to the verify package (i.e., provider-level validating, diff suppression, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants