Skip to content

Commit 7dc6d27

Browse files
feat(dynamodb): add resource polices for table (#30251)
Issue # (if applicable) Closes #29600. #29600 Reason for this change Adding a new feature Description of changes Add resourcePolicy for DynamoDB Table component in aws-dynamodb Description of how you validated changes integration test integ.dynamodb.policy.ts 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 d27de72 commit 7dc6d27

25 files changed

+1369
-15
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb-v2.policy.js.snapshot/ResourcePolicyTest-v2.assets.json

Lines changed: 20 additions & 0 deletions
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,89 @@
1+
{
2+
"Resources": {
3+
"TableTestV215EEA02B7": {
4+
"Type": "AWS::DynamoDB::GlobalTable",
5+
"Properties": {
6+
"AttributeDefinitions": [
7+
{
8+
"AttributeName": "id",
9+
"AttributeType": "S"
10+
}
11+
],
12+
"BillingMode": "PAY_PER_REQUEST",
13+
"KeySchema": [
14+
{
15+
"AttributeName": "id",
16+
"KeyType": "HASH"
17+
}
18+
],
19+
"Replicas": [
20+
{
21+
"Region": "eu-west-1",
22+
"ResourcePolicy": {
23+
"PolicyDocument": {
24+
"Statement": [
25+
{
26+
"Action": "dynamodb:*",
27+
"Effect": "Allow",
28+
"Principal": {
29+
"AWS": {
30+
"Fn::Join": [
31+
"",
32+
[
33+
"arn:aws:iam::",
34+
{
35+
"Ref": "AWS::AccountId"
36+
},
37+
":root"
38+
]
39+
]
40+
}
41+
},
42+
"Resource": "*"
43+
}
44+
],
45+
"Version": "2012-10-17"
46+
}
47+
}
48+
}
49+
]
50+
},
51+
"UpdateReplacePolicy": "Delete",
52+
"DeletionPolicy": "Delete"
53+
}
54+
},
55+
"Parameters": {
56+
"BootstrapVersion": {
57+
"Type": "AWS::SSM::Parameter::Value<String>",
58+
"Default": "/cdk-bootstrap/hnb659fds/version",
59+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
60+
}
61+
},
62+
"Rules": {
63+
"CheckBootstrapVersion": {
64+
"Assertions": [
65+
{
66+
"Assert": {
67+
"Fn::Not": [
68+
{
69+
"Fn::Contains": [
70+
[
71+
"1",
72+
"2",
73+
"3",
74+
"4",
75+
"5"
76+
],
77+
{
78+
"Ref": "BootstrapVersion"
79+
}
80+
]
81+
}
82+
]
83+
},
84+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
85+
}
86+
]
87+
}
88+
}
89+
}

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb-v2.policy.js.snapshot/cdk.out

Lines changed: 1 addition & 0 deletions
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-dynamodb/test/integ.dynamodb-v2.policy.js.snapshot/integ.json

Lines changed: 22 additions & 0 deletions
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-dynamodb/test/integ.dynamodb-v2.policy.js.snapshot/manifest.json

Lines changed: 113 additions & 0 deletions
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-dynamodb/test/integ.dynamodb-v2.policy.js.snapshot/tablev2resourcepolicyintegtestDefaultTestDeployAssertBE3353C7.assets.json

Lines changed: 19 additions & 0 deletions
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-dynamodb/test/integ.dynamodb-v2.policy.js.snapshot/tablev2resourcepolicyintegtestDefaultTestDeployAssertBE3353C7.template.json

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)