-
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
Adding support for multi-region for aws_kms_key resource #20533
Adding support for multi-region for aws_kms_key resource #20533
Conversation
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.
Welcome @bshelton 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
@bshelton any updates on the changes requested? |
Is there anything I could help with making this PR a reality? It would really help me with my job :). |
I haven't had time to work on this recently. At this point in time, the code will just create a multi-region key. However, it is not checking for the deletion of replica key in other regions. |
Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding. Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author. For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000. For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide. |
Co-authored-by: nitrocode <nitrocode@users.noreply.github.com>
Acceptance test output: % make testacc PKG_NAME=internal/service/kms TESTARGS='-run=TestAccKMSKeyDataSource_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20 -run=TestAccKMSKeyDataSource_ -timeout 180m === RUN TestAccKMSKeyDataSource_basic === PAUSE TestAccKMSKeyDataSource_basic === RUN TestAccKMSKeyDataSource_grantToken === PAUSE TestAccKMSKeyDataSource_grantToken === CONT TestAccKMSKeyDataSource_basic === CONT TestAccKMSKeyDataSource_grantToken --- PASS: TestAccKMSKeyDataSource_basic (18.84s) --- PASS: TestAccKMSKeyDataSource_grantToken (30.64s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/kms 34.883s
Acceptance test output: % make testacc PKG_NAME=internal/service/kms TESTARGS='-run=TestAccKMSKeyDataSource_basic\|TestAccKMSKeyDataSource_multiRegionConfiguration' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20 -run=TestAccKMSKeyDataSource_basic\|TestAccKMSKeyDataSource_multiRegionConfiguration -timeout 180m === RUN TestAccKMSKeyDataSource_basic === PAUSE TestAccKMSKeyDataSource_basic === RUN TestAccKMSKeyDataSource_multiRegionConfiguration === PAUSE TestAccKMSKeyDataSource_multiRegionConfiguration === CONT TestAccKMSKeyDataSource_basic === CONT TestAccKMSKeyDataSource_multiRegionConfiguration --- PASS: TestAccKMSKeyDataSource_basic (16.30s) --- PASS: TestAccKMSKeyDataSource_multiRegionConfiguration (16.42s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/kms 19.325s
Acceptance test output: % make testacc PKG_NAME=internal/service/kms TESTARGS='-run=TestAccKMSKey_basic\|TestAccKMSKey_multiRegion' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20 -run=TestAccKMSKey_basic\|TestAccKMSKey_multiRegion -timeout 180m === RUN TestAccKMSKey_basic === PAUSE TestAccKMSKey_basic === RUN TestAccKMSKey_multiRegion === PAUSE TestAccKMSKey_multiRegion === CONT TestAccKMSKey_basic === CONT TestAccKMSKey_multiRegion --- PASS: TestAccKMSKey_multiRegion (19.51s) --- PASS: TestAccKMSKey_basic (19.58s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/kms 22.232s
Acceptance test output: % make testacc PKG_NAME=internal/service/opsworks TESTARGS='-run=TestAccOpsWorksStack_classicEndpoints' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/opsworks/... -v -count 1 -parallel 20 -run=TestAccOpsWorksStack_classicEndpoints -timeout 180m === RUN TestAccOpsWorksStack_classicEndpoints === PAUSE TestAccOpsWorksStack_classicEndpoints === CONT TestAccOpsWorksStack_classicEndpoints --- PASS: TestAccOpsWorksStack_classicEndpoints (37.63s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/opsworks 42.573s
Acceptance test output: % make testacc PKG_NAME=internal/service/kms TESTARGS='-run=TestAccKMSReplicaKey_basic' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20 -run=TestAccKMSReplicaKey_basic -timeout 180m === RUN TestAccKMSReplicaKey_basic === PAUSE TestAccKMSReplicaKey_basic === CONT TestAccKMSReplicaKey_basic --- PASS: TestAccKMSReplicaKey_basic (24.25s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/kms 27.037s
…ws_partition data source'.
Acceptance test output: % make testacc PKG_NAME=internal/service/kms TESTARGS='-run=TestAccKMSExternalKey_multiRegion\|TestAccKMSExternalKey_basic' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20 -run=TestAccKMSExternalKey_multiRegion\|TestAccKMSExternalKey_basic -timeout 180m === RUN TestAccKMSExternalKey_basic === PAUSE TestAccKMSExternalKey_basic === RUN TestAccKMSExternalKey_multiRegion === PAUSE TestAccKMSExternalKey_multiRegion === CONT TestAccKMSExternalKey_basic === CONT TestAccKMSExternalKey_multiRegion --- PASS: TestAccKMSExternalKey_basic (17.32s) --- PASS: TestAccKMSExternalKey_multiRegion (17.37s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/kms 20.220s
Acceptance test output: % make testacc PKG_NAME=internal/service/kms TESTARGS='-run=TestAccKMSReplicaExternalKey_basic' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20 -run=TestAccKMSReplicaExternalKey_basic -timeout 180m === RUN TestAccKMSReplicaExternalKey_basic === PAUSE TestAccKMSReplicaExternalKey_basic === CONT TestAccKMSReplicaExternalKey_basic --- PASS: TestAccKMSReplicaExternalKey_basic (31.04s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/kms 33.807s
…scriptionAndEnabled' and 'TestAccKMSReplicaExternalKey_Tags'. Acceptance test output: % make testacc PKG_NAME=internal/service/kms TESTARGS='-run=TestAccKMSReplicaExternalKey_DescriptionAndEnabled\|TestAccKMSReplicaExternalKey_Tags' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20 -run=TestAccKMSReplicaExternalKey_DescriptionAndEnabled\|TestAccKMSReplicaExternalKey_Tags -timeout 180m === RUN TestAccKMSReplicaExternalKey_DescriptionAndEnabled === PAUSE TestAccKMSReplicaExternalKey_DescriptionAndEnabled === RUN TestAccKMSReplicaExternalKey_Tags === PAUSE TestAccKMSReplicaExternalKey_Tags === CONT TestAccKMSReplicaExternalKey_DescriptionAndEnabled === CONT TestAccKMSReplicaExternalKey_Tags --- PASS: TestAccKMSReplicaExternalKey_Tags (151.59s) --- PASS: TestAccKMSReplicaExternalKey_DescriptionAndEnabled (237.62s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/kms 240.415s
Acceptance test output: % make testacc PKG_NAME=internal/service/kms TESTARGS='-run=TestAccKMSReplicaKey_Policy' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20 -run=TestAccKMSReplicaKey_Policy -timeout 180m === RUN TestAccKMSReplicaKey_Policy === PAUSE TestAccKMSReplicaKey_Policy === CONT TestAccKMSReplicaKey_Policy --- PASS: TestAccKMSReplicaKey_Policy (49.00s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/kms 51.776s
…icy'. Acceptance test output: % make testacc PKG_NAME=internal/service/kms TESTARGS='-run=TestAccKMSReplicaExternalKey_Policy' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 20 -run=TestAccKMSReplicaExternalKey_Policy -timeout 180m === RUN TestAccKMSReplicaExternalKey_Policy === PAUSE TestAccKMSReplicaExternalKey_Policy === CONT TestAccKMSReplicaExternalKey_Policy --- PASS: TestAccKMSReplicaExternalKey_Policy (90.38s) PASS ok github.com/hashicorp/terraform-provider-aws/internal/service/kms 93.801s
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 PKG_NAME=internal/service/kms TESTARGS='-run=TestAccKMSReplicaExternalKey_\|TestAccKMSExternalKey_\|TestAccKMSKeyDataSource_\|TestAccKMSKey_' ACCTEST_PARALLELISM=10
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/kms/... -v -count 1 -parallel 10 -run=TestAccKMSReplicaExternalKey_\|TestAccKMSExternalKey_\|TestAccKMSKeyDataSource_\|TestAccKMSKey_ -timeout 180m
=== RUN TestAccKMSExternalKey_basic
=== PAUSE TestAccKMSExternalKey_basic
=== RUN TestAccKMSExternalKey_disappears
=== PAUSE TestAccKMSExternalKey_disappears
=== RUN TestAccKMSExternalKey_multiRegion
=== PAUSE TestAccKMSExternalKey_multiRegion
=== RUN TestAccKMSExternalKey_deletionWindowInDays
=== PAUSE TestAccKMSExternalKey_deletionWindowInDays
=== RUN TestAccKMSExternalKey_description
=== PAUSE TestAccKMSExternalKey_description
=== RUN TestAccKMSExternalKey_enabled
=== PAUSE TestAccKMSExternalKey_enabled
=== RUN TestAccKMSExternalKey_keyMaterialBase64
=== PAUSE TestAccKMSExternalKey_keyMaterialBase64
=== RUN TestAccKMSExternalKey_policy
=== PAUSE TestAccKMSExternalKey_policy
=== RUN TestAccKMSExternalKey_policyBypass
=== PAUSE TestAccKMSExternalKey_policyBypass
=== RUN TestAccKMSExternalKey_tags
=== PAUSE TestAccKMSExternalKey_tags
=== RUN TestAccKMSExternalKey_validTo
=== PAUSE TestAccKMSExternalKey_validTo
=== RUN TestAccKMSKeyDataSource_basic
=== PAUSE TestAccKMSKeyDataSource_basic
=== RUN TestAccKMSKeyDataSource_grantToken
=== PAUSE TestAccKMSKeyDataSource_grantToken
=== RUN TestAccKMSKeyDataSource_multiRegionConfiguration
=== PAUSE TestAccKMSKeyDataSource_multiRegionConfiguration
=== 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_policy
=== PAUSE TestAccKMSKey_policy
=== RUN TestAccKMSKey_policyBypass
=== PAUSE TestAccKMSKey_policyBypass
=== RUN TestAccKMSKey_policyBypassUpdate
=== PAUSE TestAccKMSKey_policyBypassUpdate
=== RUN TestAccKMSKey_Policy_iamRole
=== PAUSE TestAccKMSKey_Policy_iamRole
=== RUN TestAccKMSKey_Policy_iamServiceLinkedRole
=== PAUSE TestAccKMSKey_Policy_iamServiceLinkedRole
=== RUN TestAccKMSKey_isEnabled
=== PAUSE TestAccKMSKey_isEnabled
=== RUN TestAccKMSKey_tags
=== PAUSE TestAccKMSKey_tags
=== RUN TestAccKMSReplicaExternalKey_basic
=== PAUSE TestAccKMSReplicaExternalKey_basic
=== RUN TestAccKMSReplicaExternalKey_DescriptionAndEnabled
=== PAUSE TestAccKMSReplicaExternalKey_DescriptionAndEnabled
=== RUN TestAccKMSReplicaExternalKey_Policy
=== PAUSE TestAccKMSReplicaExternalKey_Policy
=== RUN TestAccKMSReplicaExternalKey_Tags
=== PAUSE TestAccKMSReplicaExternalKey_Tags
=== CONT TestAccKMSExternalKey_basic
=== CONT TestAccKMSKey_disappears
=== CONT TestAccKMSExternalKey_policyBypass
=== CONT TestAccKMSKey_isEnabled
=== CONT TestAccKMSReplicaExternalKey_Tags
=== CONT TestAccKMSReplicaExternalKey_Policy
=== CONT TestAccKMSReplicaExternalKey_DescriptionAndEnabled
=== CONT TestAccKMSReplicaExternalKey_basic
=== CONT TestAccKMSKey_tags
=== CONT TestAccKMSKey_policyBypass
--- PASS: TestAccKMSKey_disappears (45.44s)
=== CONT TestAccKMSExternalKey_description
--- PASS: TestAccKMSExternalKey_basic (56.22s)
=== CONT TestAccKMSExternalKey_policy
--- PASS: TestAccKMSExternalKey_policyBypass (64.84s)
=== CONT TestAccKMSExternalKey_keyMaterialBase64
--- PASS: TestAccKMSReplicaExternalKey_basic (75.53s)
=== CONT TestAccKMSExternalKey_enabled
--- PASS: TestAccKMSKey_tags (420.70s)
=== CONT TestAccKMSExternalKey_multiRegion
--- PASS: TestAccKMSExternalKey_description (258.48s)
=== CONT TestAccKMSExternalKey_deletionWindowInDays
--- PASS: TestAccKMSExternalKey_multiRegion (39.69s)
=== CONT TestAccKMSKey_asymmetricKey
--- PASS: TestAccKMSExternalKey_policy (84.65s)
=== CONT TestAccKMSKey_policy
--- PASS: TestAccKMSReplicaExternalKey_Policy (157.73s)
=== CONT TestAccKMSKey_Policy_iamRole
--- PASS: TestAccKMSKey_asymmetricKey (32.47s)
=== CONT TestAccKMSKey_Policy_iamServiceLinkedRole
--- PASS: TestAccKMSExternalKey_deletionWindowInDays (65.00s)
=== CONT TestAccKMSKey_basic
--- PASS: TestAccKMSKey_policyBypass (200.30s)
=== CONT TestAccKMSKey_policyBypassUpdate
--- PASS: TestAccKMSKey_policy (73.47s)
=== CONT TestAccKMSKeyDataSource_grantToken
--- PASS: TestAccKMSKey_basic (42.73s)
=== CONT TestAccKMSExternalKey_validTo
--- PASS: TestAccKMSKey_Policy_iamRole (66.91s)
=== CONT TestAccKMSKeyDataSource_basic
--- PASS: TestAccKMSExternalKey_keyMaterialBase64 (174.61s)
=== CONT TestAccKMSExternalKey_disappears
--- PASS: TestAccKMSKey_Policy_iamServiceLinkedRole (80.09s)
=== CONT TestAccKMSKeyDataSource_multiRegionConfiguration
--- PASS: TestAccKMSKeyDataSource_basic (32.46s)
=== CONT TestAccKMSKey_multiRegion
--- PASS: TestAccKMSKeyDataSource_grantToken (43.17s)
=== CONT TestAccKMSExternalKey_tags
--- PASS: TestAccKMSExternalKey_disappears (23.31s)
--- PASS: TestAccKMSKey_policyBypassUpdate (74.00s)
--- PASS: TestAccKMSKeyDataSource_multiRegionConfiguration (34.06s)
--- PASS: TestAccKMSReplicaExternalKey_Tags (287.35s)
--- PASS: TestAccKMSKey_multiRegion (51.03s)
--- PASS: TestAccKMSExternalKey_enabled (247.44s)
--- PASS: TestAccKMSReplicaExternalKey_DescriptionAndEnabled (392.25s)
--- PASS: TestAccKMSKey_isEnabled (429.10s)
--- PASS: TestAccKMSExternalKey_tags (244.20s)
--- PASS: TestAccKMSExternalKey_validTo (625.75s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/kms 846.732s
@bshelton Thanks for the contribution 🎉 👏. |
This functionality has been released in v3.64.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! |
The `multi_region` attribute in the KMS key was created in version 3.64.0, we should pin the version of the aws provider to be major than that version. hashicorp/terraform-provider-aws#20533 Closes #73 Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
The `multi_region` attribute in the KMS key was created in version 3.64.0, we should pin the version of the aws provider to be major than that version. hashicorp/terraform-provider-aws#20533 Closes #73 Signed-off-by: Salim Afiune Maya <afiune@lacework.net>
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. |
Community Note
Relates OR Closes #19896
Output from acceptance testing: