Skip to content

Commit d5a19bb

Browse files
feat(dynamodb): adding on-demand-throughput to table (#30725)
### Issue # (if applicable) Closes #30091 ### Reason for this change New DynamoDB feature that was just released ### Description of changes Added `maxReadRequestUnits` and `maxWriteRequestUnits` for PAY_PER_REQUEST tables ### Description of how you validated changes Tests on `integ.dynamodb.ondemand.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 abc78bf commit d5a19bb

35 files changed

+1987
-120
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb-v2.max-request-units.js.snapshot/aws-cdk-global-table-v2.assets.json

+20
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,117 @@
1+
{
2+
"Resources": {
3+
"GlobalTableV212B4E024": {
4+
"Type": "AWS::DynamoDB::GlobalTable",
5+
"Properties": {
6+
"AttributeDefinitions": [
7+
{
8+
"AttributeName": "pk",
9+
"AttributeType": "S"
10+
},
11+
{
12+
"AttributeName": "sk",
13+
"AttributeType": "N"
14+
}
15+
],
16+
"BillingMode": "PAY_PER_REQUEST",
17+
"GlobalSecondaryIndexes": [
18+
{
19+
"IndexName": "gsi2",
20+
"KeySchema": [
21+
{
22+
"AttributeName": "pk",
23+
"KeyType": "HASH"
24+
}
25+
],
26+
"Projection": {
27+
"ProjectionType": "ALL"
28+
},
29+
"WriteOnDemandThroughputSettings": {
30+
"MaxWriteRequestUnits": 2001
31+
}
32+
}
33+
],
34+
"KeySchema": [
35+
{
36+
"AttributeName": "pk",
37+
"KeyType": "HASH"
38+
},
39+
{
40+
"AttributeName": "sk",
41+
"KeyType": "RANGE"
42+
}
43+
],
44+
"Replicas": [
45+
{
46+
"GlobalSecondaryIndexes": [
47+
{
48+
"IndexName": "gsi2",
49+
"ReadOnDemandThroughputSettings": {
50+
"MaxReadRequestUnits": 2001
51+
}
52+
}
53+
],
54+
"ReadOnDemandThroughputSettings": {
55+
"MaxReadRequestUnits": 222
56+
},
57+
"Region": "us-east-1"
58+
},
59+
{
60+
"GlobalSecondaryIndexes": [
61+
{
62+
"IndexName": "gsi2",
63+
"ReadOnDemandThroughputSettings": {
64+
"MaxReadRequestUnits": 2001
65+
}
66+
}
67+
],
68+
"Region": "eu-west-1"
69+
}
70+
],
71+
"StreamSpecification": {
72+
"StreamViewType": "NEW_AND_OLD_IMAGES"
73+
},
74+
"TableName": "my-global-table-v2",
75+
"WriteOnDemandThroughputSettings": {
76+
"MaxWriteRequestUnits": 10
77+
}
78+
},
79+
"UpdateReplacePolicy": "Delete",
80+
"DeletionPolicy": "Delete"
81+
}
82+
},
83+
"Parameters": {
84+
"BootstrapVersion": {
85+
"Type": "AWS::SSM::Parameter::Value<String>",
86+
"Default": "/cdk-bootstrap/hnb659fds/version",
87+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
88+
}
89+
},
90+
"Rules": {
91+
"CheckBootstrapVersion": {
92+
"Assertions": [
93+
{
94+
"Assert": {
95+
"Fn::Not": [
96+
{
97+
"Fn::Contains": [
98+
[
99+
"1",
100+
"2",
101+
"3",
102+
"4",
103+
"5"
104+
],
105+
{
106+
"Ref": "BootstrapVersion"
107+
}
108+
]
109+
}
110+
]
111+
},
112+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
113+
}
114+
]
115+
}
116+
}
117+
}

packages/@aws-cdk-testing/framework-integ/test/aws-dynamodb/test/integ.dynamodb-v2.max-request-units.js.snapshot/awscdkglobaltableintegv2DefaultTestDeployAssertF1A4FD2A.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-dynamodb/test/integ.dynamodb-v2.max-request-units.js.snapshot/awscdkglobaltableintegv2DefaultTestDeployAssertF1A4FD2A.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-dynamodb/test/integ.dynamodb-v2.max-request-units.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-dynamodb/test/integ.dynamodb-v2.max-request-units.js.snapshot/integ.json

+16
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.max-request-units.js.snapshot/manifest.json

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

0 commit comments

Comments
 (0)