Skip to content

Commit 046b06d

Browse files
committed
feat(dynamodb): compound keys for global secondary indexes
1 parent 73b9f98 commit 046b06d

27 files changed

+2739
-74
lines changed

allowed-breaking-changes.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4002,3 +4002,6 @@ move:aws-cdk-lib.IEnvironmentAware
40024002
move:aws-cdk-lib.ResourceEnvironment aws-cdk-lib.interfaces.ResourceEnvironment
40034003

40044004
removed:aws-cdk-lib.aws_dynamodb.Table.table
4005+
4006+
# Making aws-dynamodb partitionKey optional to support schema() function and compound keys
4007+
weakened:aws-cdk-lib.aws_dynamodb.SchemaOptions

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.compound.js.snapshot/aws-cdk-dynamodb-compound-keys.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,150 @@
1+
{
2+
"Resources": {
3+
"TableCD117FA1": {
4+
"Type": "AWS::DynamoDB::Table",
5+
"Properties": {
6+
"AttributeDefinitions": [
7+
{
8+
"AttributeName": "pkey",
9+
"AttributeType": "N"
10+
},
11+
{
12+
"AttributeName": "PK1",
13+
"AttributeType": "S"
14+
},
15+
{
16+
"AttributeName": "PK2",
17+
"AttributeType": "N"
18+
},
19+
{
20+
"AttributeName": "SK1",
21+
"AttributeType": "S"
22+
},
23+
{
24+
"AttributeName": "SK2",
25+
"AttributeType": "N"
26+
},
27+
{
28+
"AttributeName": "baz",
29+
"AttributeType": "S"
30+
},
31+
{
32+
"AttributeName": "bar",
33+
"AttributeType": "S"
34+
},
35+
{
36+
"AttributeName": "foo",
37+
"AttributeType": "N"
38+
}
39+
],
40+
"GlobalSecondaryIndexes": [
41+
{
42+
"IndexName": "IndexA",
43+
"KeySchema": [
44+
{
45+
"AttributeName": "PK1",
46+
"KeyType": "HASH"
47+
},
48+
{
49+
"AttributeName": "PK2",
50+
"KeyType": "HASH"
51+
},
52+
{
53+
"AttributeName": "SK1",
54+
"KeyType": "RANGE"
55+
},
56+
{
57+
"AttributeName": "SK2",
58+
"KeyType": "RANGE"
59+
}
60+
],
61+
"Projection": {
62+
"NonKeyAttributes": [
63+
"bar"
64+
],
65+
"ProjectionType": "INCLUDE"
66+
},
67+
"ProvisionedThroughput": {
68+
"ReadCapacityUnits": 5,
69+
"WriteCapacityUnits": 5
70+
}
71+
},
72+
{
73+
"IndexName": "IndexB",
74+
"KeySchema": [
75+
{
76+
"AttributeName": "baz",
77+
"KeyType": "HASH"
78+
},
79+
{
80+
"AttributeName": "bar",
81+
"KeyType": "RANGE"
82+
},
83+
{
84+
"AttributeName": "foo",
85+
"KeyType": "RANGE"
86+
}
87+
],
88+
"Projection": {
89+
"NonKeyAttributes": [
90+
"blah"
91+
],
92+
"ProjectionType": "INCLUDE"
93+
},
94+
"ProvisionedThroughput": {
95+
"ReadCapacityUnits": 5,
96+
"WriteCapacityUnits": 5
97+
}
98+
}
99+
],
100+
"KeySchema": [
101+
{
102+
"AttributeName": "pkey",
103+
"KeyType": "HASH"
104+
}
105+
],
106+
"ProvisionedThroughput": {
107+
"ReadCapacityUnits": 5,
108+
"WriteCapacityUnits": 5
109+
},
110+
"TableName": "cdk-test-compound"
111+
},
112+
"UpdateReplacePolicy": "Delete",
113+
"DeletionPolicy": "Delete"
114+
}
115+
},
116+
"Parameters": {
117+
"BootstrapVersion": {
118+
"Type": "AWS::SSM::Parameter::Value<String>",
119+
"Default": "/cdk-bootstrap/hnb659fds/version",
120+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
121+
}
122+
},
123+
"Rules": {
124+
"CheckBootstrapVersion": {
125+
"Assertions": [
126+
{
127+
"Assert": {
128+
"Fn::Not": [
129+
{
130+
"Fn::Contains": [
131+
[
132+
"1",
133+
"2",
134+
"3",
135+
"4",
136+
"5"
137+
],
138+
{
139+
"Ref": "BootstrapVersion"
140+
}
141+
]
142+
}
143+
]
144+
},
145+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
146+
}
147+
]
148+
}
149+
}
150+
}

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.compound.js.snapshot/awscdkdynamodbcompoundkeygsiDefaultTestDeployAssert1C1D9A72.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.

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.compound.js.snapshot/awscdkdynamodbcompoundkeygsiDefaultTestDeployAssert1C1D9A72.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.

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb.compound.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.compound.js.snapshot/integ.json

Lines changed: 13 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)