Skip to content

Commit 2323877

Browse files
authored
feat(kms): support KEY_AGREEMENT for keyUsage (#30993)
### Issue # (if applicable) Closes #30989 ### Reason for this change To support `KEY_AGREEMENT` for KeyUsage. ### Description of changes * Add `KEY_AGREEMENT` to KeyUsage enum * Add validation rule ### Description of how you validated changes Add unit test and integ test. ### 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 8c80bf8 commit 2323877

11 files changed

+475
-0
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-kms/test/integ.key-key-agreement.js.snapshot/KeyAgreementIntegTestDefaultTestDeployAssert01B3C2C1.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-key-agreement.js.snapshot/KeyAgreementIntegTestDefaultTestDeployAssert01B3C2C1.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-key-agreement.js.snapshot/aws-cdk-kms-key-agreement.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,75 @@
1+
{
2+
"Resources": {
3+
"MyKeyAgreementKey1B696107": {
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+
"KeySpec": "ECC_NIST_P256",
35+
"KeyUsage": "KEY_AGREEMENT"
36+
},
37+
"UpdateReplacePolicy": "Delete",
38+
"DeletionPolicy": "Delete"
39+
}
40+
},
41+
"Parameters": {
42+
"BootstrapVersion": {
43+
"Type": "AWS::SSM::Parameter::Value<String>",
44+
"Default": "/cdk-bootstrap/hnb659fds/version",
45+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
46+
}
47+
},
48+
"Rules": {
49+
"CheckBootstrapVersion": {
50+
"Assertions": [
51+
{
52+
"Assert": {
53+
"Fn::Not": [
54+
{
55+
"Fn::Contains": [
56+
[
57+
"1",
58+
"2",
59+
"3",
60+
"4",
61+
"5"
62+
],
63+
{
64+
"Ref": "BootstrapVersion"
65+
}
66+
]
67+
}
68+
]
69+
},
70+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
71+
}
72+
]
73+
}
74+
}
75+
}

packages/@aws-cdk-testing/framework-integ/test/aws-kms/test/integ.key-key-agreement.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-key-agreement.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-key-agreement.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)