Skip to content

Commit 7a4330d

Browse files
author
awstools
committed
feat(client-dynamodb): This release adds support to specify an optional, maximum OnDemandThroughput for DynamoDB tables and global secondary indexes in the CreateTable or UpdateTable APIs. You can also override the OnDemandThroughput settings by calling the ImportTable, RestoreFromPointInTime, or RestoreFromBackup APIs.
1 parent 3c7432b commit 7a4330d

18 files changed

+492
-21
lines changed

clients/client-dynamodb/src/commands/CreateGlobalTableCommand.ts

+6
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,18 @@ export interface CreateGlobalTableCommandOutput extends CreateGlobalTableOutput,
118118
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
119119
* // ReadCapacityUnits: Number("long"),
120120
* // },
121+
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
122+
* // MaxReadRequestUnits: Number("long"),
123+
* // },
121124
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
122125
* // { // ReplicaGlobalSecondaryIndexDescription
123126
* // IndexName: "STRING_VALUE",
124127
* // ProvisionedThroughputOverride: {
125128
* // ReadCapacityUnits: Number("long"),
126129
* // },
130+
* // OnDemandThroughputOverride: {
131+
* // MaxReadRequestUnits: Number("long"),
132+
* // },
127133
* // },
128134
* // ],
129135
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),

clients/client-dynamodb/src/commands/CreateTableCommand.ts

+22
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ export interface CreateTableCommandOutput extends CreateTableOutput, __MetadataB
9696
* ReadCapacityUnits: Number("long"), // required
9797
* WriteCapacityUnits: Number("long"), // required
9898
* },
99+
* OnDemandThroughput: { // OnDemandThroughput
100+
* MaxReadRequestUnits: Number("long"),
101+
* MaxWriteRequestUnits: Number("long"),
102+
* },
99103
* },
100104
* ],
101105
* BillingMode: "PROVISIONED" || "PAY_PER_REQUEST",
@@ -121,6 +125,10 @@ export interface CreateTableCommandOutput extends CreateTableOutput, __MetadataB
121125
* TableClass: "STANDARD" || "STANDARD_INFREQUENT_ACCESS",
122126
* DeletionProtectionEnabled: true || false,
123127
* ResourcePolicy: "STRING_VALUE",
128+
* OnDemandThroughput: {
129+
* MaxReadRequestUnits: Number("long"),
130+
* MaxWriteRequestUnits: Number("long"),
131+
* },
124132
* };
125133
* const command = new CreateTableCommand(input);
126134
* const response = await client.send(command);
@@ -203,6 +211,10 @@ export interface CreateTableCommandOutput extends CreateTableOutput, __MetadataB
203211
* // IndexSizeBytes: Number("long"),
204212
* // ItemCount: Number("long"),
205213
* // IndexArn: "STRING_VALUE",
214+
* // OnDemandThroughput: { // OnDemandThroughput
215+
* // MaxReadRequestUnits: Number("long"),
216+
* // MaxWriteRequestUnits: Number("long"),
217+
* // },
206218
* // },
207219
* // ],
208220
* // StreamSpecification: { // StreamSpecification
@@ -222,12 +234,18 @@ export interface CreateTableCommandOutput extends CreateTableOutput, __MetadataB
222234
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
223235
* // ReadCapacityUnits: Number("long"),
224236
* // },
237+
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
238+
* // MaxReadRequestUnits: Number("long"),
239+
* // },
225240
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
226241
* // { // ReplicaGlobalSecondaryIndexDescription
227242
* // IndexName: "STRING_VALUE",
228243
* // ProvisionedThroughputOverride: {
229244
* // ReadCapacityUnits: Number("long"),
230245
* // },
246+
* // OnDemandThroughputOverride: {
247+
* // MaxReadRequestUnits: Number("long"),
248+
* // },
231249
* // },
232250
* // ],
233251
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),
@@ -259,6 +277,10 @@ export interface CreateTableCommandOutput extends CreateTableOutput, __MetadataB
259277
* // LastUpdateDateTime: new Date("TIMESTAMP"),
260278
* // },
261279
* // DeletionProtectionEnabled: true || false,
280+
* // OnDemandThroughput: {
281+
* // MaxReadRequestUnits: Number("long"),
282+
* // MaxWriteRequestUnits: Number("long"),
283+
* // },
262284
* // },
263285
* // };
264286
*

clients/client-dynamodb/src/commands/DeleteBackupCommand.ts

+8
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ export interface DeleteBackupCommandOutput extends DeleteBackupOutput, __Metadat
6868
* // ReadCapacityUnits: Number("long"), // required
6969
* // WriteCapacityUnits: Number("long"), // required
7070
* // },
71+
* // OnDemandThroughput: { // OnDemandThroughput
72+
* // MaxReadRequestUnits: Number("long"),
73+
* // MaxWriteRequestUnits: Number("long"),
74+
* // },
7175
* // ItemCount: Number("long"),
7276
* // BillingMode: "PROVISIONED" || "PAY_PER_REQUEST",
7377
* // },
@@ -108,6 +112,10 @@ export interface DeleteBackupCommandOutput extends DeleteBackupOutput, __Metadat
108112
* // ReadCapacityUnits: Number("long"), // required
109113
* // WriteCapacityUnits: Number("long"), // required
110114
* // },
115+
* // OnDemandThroughput: {
116+
* // MaxReadRequestUnits: Number("long"),
117+
* // MaxWriteRequestUnits: Number("long"),
118+
* // },
111119
* // },
112120
* // ],
113121
* // StreamDescription: { // StreamSpecification

clients/client-dynamodb/src/commands/DeleteTableCommand.ts

+14
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ export interface DeleteTableCommandOutput extends DeleteTableOutput, __MetadataB
140140
* // IndexSizeBytes: Number("long"),
141141
* // ItemCount: Number("long"),
142142
* // IndexArn: "STRING_VALUE",
143+
* // OnDemandThroughput: { // OnDemandThroughput
144+
* // MaxReadRequestUnits: Number("long"),
145+
* // MaxWriteRequestUnits: Number("long"),
146+
* // },
143147
* // },
144148
* // ],
145149
* // StreamSpecification: { // StreamSpecification
@@ -159,12 +163,18 @@ export interface DeleteTableCommandOutput extends DeleteTableOutput, __MetadataB
159163
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
160164
* // ReadCapacityUnits: Number("long"),
161165
* // },
166+
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
167+
* // MaxReadRequestUnits: Number("long"),
168+
* // },
162169
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
163170
* // { // ReplicaGlobalSecondaryIndexDescription
164171
* // IndexName: "STRING_VALUE",
165172
* // ProvisionedThroughputOverride: {
166173
* // ReadCapacityUnits: Number("long"),
167174
* // },
175+
* // OnDemandThroughputOverride: {
176+
* // MaxReadRequestUnits: Number("long"),
177+
* // },
168178
* // },
169179
* // ],
170180
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),
@@ -196,6 +206,10 @@ export interface DeleteTableCommandOutput extends DeleteTableOutput, __MetadataB
196206
* // LastUpdateDateTime: new Date("TIMESTAMP"),
197207
* // },
198208
* // DeletionProtectionEnabled: true || false,
209+
* // OnDemandThroughput: {
210+
* // MaxReadRequestUnits: Number("long"),
211+
* // MaxWriteRequestUnits: Number("long"),
212+
* // },
199213
* // },
200214
* // };
201215
*

clients/client-dynamodb/src/commands/DescribeBackupCommand.ts

+8
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ export interface DescribeBackupCommandOutput extends DescribeBackupOutput, __Met
6868
* // ReadCapacityUnits: Number("long"), // required
6969
* // WriteCapacityUnits: Number("long"), // required
7070
* // },
71+
* // OnDemandThroughput: { // OnDemandThroughput
72+
* // MaxReadRequestUnits: Number("long"),
73+
* // MaxWriteRequestUnits: Number("long"),
74+
* // },
7175
* // ItemCount: Number("long"),
7276
* // BillingMode: "PROVISIONED" || "PAY_PER_REQUEST",
7377
* // },
@@ -108,6 +112,10 @@ export interface DescribeBackupCommandOutput extends DescribeBackupOutput, __Met
108112
* // ReadCapacityUnits: Number("long"), // required
109113
* // WriteCapacityUnits: Number("long"), // required
110114
* // },
115+
* // OnDemandThroughput: {
116+
* // MaxReadRequestUnits: Number("long"),
117+
* // MaxWriteRequestUnits: Number("long"),
118+
* // },
111119
* // },
112120
* // ],
113121
* // StreamDescription: { // StreamSpecification

clients/client-dynamodb/src/commands/DescribeGlobalTableCommand.ts

+6
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,18 @@ export interface DescribeGlobalTableCommandOutput extends DescribeGlobalTableOut
6363
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
6464
* // ReadCapacityUnits: Number("long"),
6565
* // },
66+
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
67+
* // MaxReadRequestUnits: Number("long"),
68+
* // },
6669
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
6770
* // { // ReplicaGlobalSecondaryIndexDescription
6871
* // IndexName: "STRING_VALUE",
6972
* // ProvisionedThroughputOverride: {
7073
* // ReadCapacityUnits: Number("long"),
7174
* // },
75+
* // OnDemandThroughputOverride: {
76+
* // MaxReadRequestUnits: Number("long"),
77+
* // },
7278
* // },
7379
* // ],
7480
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),

clients/client-dynamodb/src/commands/DescribeImportCommand.ts

+8
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ export interface DescribeImportCommandOutput extends DescribeImportOutput, __Met
8282
* // ReadCapacityUnits: Number("long"), // required
8383
* // WriteCapacityUnits: Number("long"), // required
8484
* // },
85+
* // OnDemandThroughput: { // OnDemandThroughput
86+
* // MaxReadRequestUnits: Number("long"),
87+
* // MaxWriteRequestUnits: Number("long"),
88+
* // },
8589
* // SSESpecification: { // SSESpecification
8690
* // Enabled: true || false,
8791
* // SSEType: "AES256" || "KMS",
@@ -106,6 +110,10 @@ export interface DescribeImportCommandOutput extends DescribeImportOutput, __Met
106110
* // ReadCapacityUnits: Number("long"), // required
107111
* // WriteCapacityUnits: Number("long"), // required
108112
* // },
113+
* // OnDemandThroughput: {
114+
* // MaxReadRequestUnits: Number("long"),
115+
* // MaxWriteRequestUnits: Number("long"),
116+
* // },
109117
* // },
110118
* // ],
111119
* // },

clients/client-dynamodb/src/commands/DescribeTableCommand.ts

+14
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ export interface DescribeTableCommandOutput extends DescribeTableOutput, __Metad
132132
* // IndexSizeBytes: Number("long"),
133133
* // ItemCount: Number("long"),
134134
* // IndexArn: "STRING_VALUE",
135+
* // OnDemandThroughput: { // OnDemandThroughput
136+
* // MaxReadRequestUnits: Number("long"),
137+
* // MaxWriteRequestUnits: Number("long"),
138+
* // },
135139
* // },
136140
* // ],
137141
* // StreamSpecification: { // StreamSpecification
@@ -151,12 +155,18 @@ export interface DescribeTableCommandOutput extends DescribeTableOutput, __Metad
151155
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
152156
* // ReadCapacityUnits: Number("long"),
153157
* // },
158+
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
159+
* // MaxReadRequestUnits: Number("long"),
160+
* // },
154161
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
155162
* // { // ReplicaGlobalSecondaryIndexDescription
156163
* // IndexName: "STRING_VALUE",
157164
* // ProvisionedThroughputOverride: {
158165
* // ReadCapacityUnits: Number("long"),
159166
* // },
167+
* // OnDemandThroughputOverride: {
168+
* // MaxReadRequestUnits: Number("long"),
169+
* // },
160170
* // },
161171
* // ],
162172
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),
@@ -188,6 +198,10 @@ export interface DescribeTableCommandOutput extends DescribeTableOutput, __Metad
188198
* // LastUpdateDateTime: new Date("TIMESTAMP"),
189199
* // },
190200
* // DeletionProtectionEnabled: true || false,
201+
* // OnDemandThroughput: {
202+
* // MaxReadRequestUnits: Number("long"),
203+
* // MaxWriteRequestUnits: Number("long"),
204+
* // },
191205
* // },
192206
* // };
193207
*

clients/client-dynamodb/src/commands/GetResourcePolicyCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface GetResourcePolicyCommandOutput extends GetResourcePolicyOutput,
4444
* </li>
4545
* </ul>
4646
* <p>Because <code>GetResourcePolicy</code> uses an <i>eventually consistent</i> query, the metadata for your policy or table might not be available at that moment. Wait for a few seconds, and then retry the <code>GetResourcePolicy</code> request.</p>
47-
* <p>After a <code>GetResourcePolicy</code> request returns a policy created using the <code>PutResourcePolicy</code> request, you can assume the policy will start getting applied in the authorization of requests to the resource. Because this process is eventually consistent, it will take some time to apply the policy to all requests to a resource. Policies that you attach while creating a table using the <code>CreateTable</code> request will always be applied to all requests for that table.</p>
47+
* <p>After a <code>GetResourcePolicy</code> request returns a policy created using the <code>PutResourcePolicy</code> request, the policy will be applied in the authorization of requests to the resource. Because this process is eventually consistent, it will take some time to apply the policy to all requests to a resource. Policies that you attach while creating a table using the <code>CreateTable</code> request will always be applied to all requests for that table.</p>
4848
* @example
4949
* Use a bare-bones client and the command you need to make an API call.
5050
* ```javascript

clients/client-dynamodb/src/commands/ImportTableCommand.ts

+16
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ export interface ImportTableCommandOutput extends ImportTableOutput, __MetadataB
7070
* ReadCapacityUnits: Number("long"), // required
7171
* WriteCapacityUnits: Number("long"), // required
7272
* },
73+
* OnDemandThroughput: { // OnDemandThroughput
74+
* MaxReadRequestUnits: Number("long"),
75+
* MaxWriteRequestUnits: Number("long"),
76+
* },
7377
* SSESpecification: { // SSESpecification
7478
* Enabled: true || false,
7579
* SSEType: "AES256" || "KMS",
@@ -94,6 +98,10 @@ export interface ImportTableCommandOutput extends ImportTableOutput, __MetadataB
9498
* ReadCapacityUnits: Number("long"), // required
9599
* WriteCapacityUnits: Number("long"), // required
96100
* },
101+
* OnDemandThroughput: {
102+
* MaxReadRequestUnits: Number("long"),
103+
* MaxWriteRequestUnits: Number("long"),
104+
* },
97105
* },
98106
* ],
99107
* },
@@ -143,6 +151,10 @@ export interface ImportTableCommandOutput extends ImportTableOutput, __MetadataB
143151
* // ReadCapacityUnits: Number("long"), // required
144152
* // WriteCapacityUnits: Number("long"), // required
145153
* // },
154+
* // OnDemandThroughput: { // OnDemandThroughput
155+
* // MaxReadRequestUnits: Number("long"),
156+
* // MaxWriteRequestUnits: Number("long"),
157+
* // },
146158
* // SSESpecification: { // SSESpecification
147159
* // Enabled: true || false,
148160
* // SSEType: "AES256" || "KMS",
@@ -167,6 +179,10 @@ export interface ImportTableCommandOutput extends ImportTableOutput, __MetadataB
167179
* // ReadCapacityUnits: Number("long"), // required
168180
* // WriteCapacityUnits: Number("long"), // required
169181
* // },
182+
* // OnDemandThroughput: {
183+
* // MaxReadRequestUnits: Number("long"),
184+
* // MaxWriteRequestUnits: Number("long"),
185+
* // },
170186
* // },
171187
* // ],
172188
* // },

clients/client-dynamodb/src/commands/PutResourcePolicyCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface PutResourcePolicyCommandOutput extends PutResourcePolicyOutput,
3131
* <i>eventually consistent</i>
3232
* </a>.</p>
3333
* <p>
34-
* <code>PutResourcePolicy</code> is an idempotent operation; running it multiple times on the same resource using the same policy document will return the same revision ID. If you specify an <code>ExpectedRevisionId</code> which doesn't match the current policy's <code>RevisionId</code>, the <code>PolicyNotFoundException</code> will be returned.</p>
34+
* <code>PutResourcePolicy</code> is an idempotent operation; running it multiple times on the same resource using the same policy document will return the same revision ID. If you specify an <code>ExpectedRevisionId</code> that doesn't match the current policy's <code>RevisionId</code>, the <code>PolicyNotFoundException</code> will be returned.</p>
3535
* <note>
3636
* <p>
3737
* <code>PutResourcePolicy</code> is an asynchronous operation. If you issue a <code>GetResourcePolicy</code> request immediately after a <code>PutResourcePolicy</code> request, DynamoDB might return your previous policy, if there was one, or return the <code>PolicyNotFoundException</code>. This is because <code>GetResourcePolicy</code> uses an eventually consistent query, and the metadata for your policy or table might not be available at that moment. Wait for a few seconds, and then try the <code>GetResourcePolicy</code> request again.</p>

clients/client-dynamodb/src/commands/RestoreTableFromBackupCommand.ts

+22
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ export interface RestoreTableFromBackupCommandOutput extends RestoreTableFromBac
8181
* ReadCapacityUnits: Number("long"), // required
8282
* WriteCapacityUnits: Number("long"), // required
8383
* },
84+
* OnDemandThroughput: { // OnDemandThroughput
85+
* MaxReadRequestUnits: Number("long"),
86+
* MaxWriteRequestUnits: Number("long"),
87+
* },
8488
* },
8589
* ],
8690
* LocalSecondaryIndexOverride: [ // LocalSecondaryIndexList
@@ -104,6 +108,10 @@ export interface RestoreTableFromBackupCommandOutput extends RestoreTableFromBac
104108
* ReadCapacityUnits: Number("long"), // required
105109
* WriteCapacityUnits: Number("long"), // required
106110
* },
111+
* OnDemandThroughputOverride: {
112+
* MaxReadRequestUnits: Number("long"),
113+
* MaxWriteRequestUnits: Number("long"),
114+
* },
107115
* SSESpecificationOverride: { // SSESpecification
108116
* Enabled: true || false,
109117
* SSEType: "AES256" || "KMS",
@@ -191,6 +199,10 @@ export interface RestoreTableFromBackupCommandOutput extends RestoreTableFromBac
191199
* // IndexSizeBytes: Number("long"),
192200
* // ItemCount: Number("long"),
193201
* // IndexArn: "STRING_VALUE",
202+
* // OnDemandThroughput: { // OnDemandThroughput
203+
* // MaxReadRequestUnits: Number("long"),
204+
* // MaxWriteRequestUnits: Number("long"),
205+
* // },
194206
* // },
195207
* // ],
196208
* // StreamSpecification: { // StreamSpecification
@@ -210,12 +222,18 @@ export interface RestoreTableFromBackupCommandOutput extends RestoreTableFromBac
210222
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
211223
* // ReadCapacityUnits: Number("long"),
212224
* // },
225+
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
226+
* // MaxReadRequestUnits: Number("long"),
227+
* // },
213228
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
214229
* // { // ReplicaGlobalSecondaryIndexDescription
215230
* // IndexName: "STRING_VALUE",
216231
* // ProvisionedThroughputOverride: {
217232
* // ReadCapacityUnits: Number("long"),
218233
* // },
234+
* // OnDemandThroughputOverride: {
235+
* // MaxReadRequestUnits: Number("long"),
236+
* // },
219237
* // },
220238
* // ],
221239
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),
@@ -247,6 +265,10 @@ export interface RestoreTableFromBackupCommandOutput extends RestoreTableFromBac
247265
* // LastUpdateDateTime: new Date("TIMESTAMP"),
248266
* // },
249267
* // DeletionProtectionEnabled: true || false,
268+
* // OnDemandThroughput: {
269+
* // MaxReadRequestUnits: Number("long"),
270+
* // MaxWriteRequestUnits: Number("long"),
271+
* // },
250272
* // },
251273
* // };
252274
*

0 commit comments

Comments
 (0)