Skip to content

Commit 3dc4c50

Browse files
authored
feat(kms): add multiRegion property to a Key (#31125)
### Issue # (if applicable) None ### Reason for this change We can create a multi-Region primary key for a KMS key from cloudformation, but this was not supported in the AWS CDK L2 construct. ### Description of changes Add multiRegion property to KeyProps and set it in the CfnKey constructor. ### Description of how you validated changes Added both unit and integration tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 64df08b commit 3dc4c50

12 files changed

+481
-0
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-kms/test/integ.key-multi-region.js.snapshot/KmsKeyMultiRegionStack.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"Resources": {
3+
"keyFEDD6EC0": {
4+
"Type": "AWS::KMS::Key",
5+
"Properties": {
6+
"KeyPolicy": {
7+
"Statement": [
8+
{
9+
"Action": "kms:*",
10+
"Effect": "Allow",
11+
"Principal": {
12+
"AWS": {
13+
"Fn::Join": [
14+
"",
15+
[
16+
"arn:",
17+
{
18+
"Ref": "AWS::Partition"
19+
},
20+
":iam::",
21+
{
22+
"Ref": "AWS::AccountId"
23+
},
24+
":root"
25+
]
26+
]
27+
}
28+
},
29+
"Resource": "*"
30+
}
31+
],
32+
"Version": "2012-10-17"
33+
},
34+
"MultiRegion": true
35+
},
36+
"UpdateReplacePolicy": "Retain",
37+
"DeletionPolicy": "Retain"
38+
}
39+
},
40+
"Parameters": {
41+
"BootstrapVersion": {
42+
"Type": "AWS::SSM::Parameter::Value<String>",
43+
"Default": "/cdk-bootstrap/hnb659fds/version",
44+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
45+
}
46+
},
47+
"Rules": {
48+
"CheckBootstrapVersion": {
49+
"Assertions": [
50+
{
51+
"Assert": {
52+
"Fn::Not": [
53+
{
54+
"Fn::Contains": [
55+
[
56+
"1",
57+
"2",
58+
"3",
59+
"4",
60+
"5"
61+
],
62+
{
63+
"Ref": "BootstrapVersion"
64+
}
65+
]
66+
}
67+
]
68+
},
69+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
70+
}
71+
]
72+
}
73+
}
74+
}

packages/@aws-cdk-testing/framework-integ/test/aws-kms/test/integ.key-multi-region.js.snapshot/cdk.out

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-kms/test/integ.key-multi-region.js.snapshot/integ.json

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-kms/test/integ.key-multi-region.js.snapshot/kmskeymultiregionDefaultTestDeployAssert5D62E49E.assets.json

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-kms/test/integ.key-multi-region.js.snapshot/kmskeymultiregionDefaultTestDeployAssert5D62E49E.template.json

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-kms/test/integ.key-multi-region.js.snapshot/manifest.json

+113
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)