Skip to content

Commit

Permalink
feat(client-dynamodb): This release adds support to specify an option…
Browse files Browse the repository at this point in the history
…al, 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.
  • Loading branch information
awstools committed May 2, 2024
1 parent 3c7432b commit 7a4330d
Show file tree
Hide file tree
Showing 18 changed files with 492 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,18 @@ export interface CreateGlobalTableCommandOutput extends CreateGlobalTableOutput,
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
* // MaxReadRequestUnits: Number("long"),
* // },
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
* // { // ReplicaGlobalSecondaryIndexDescription
* // IndexName: "STRING_VALUE",
* // ProvisionedThroughputOverride: {
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: {
* // MaxReadRequestUnits: Number("long"),
* // },
* // },
* // ],
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),
Expand Down
22 changes: 22 additions & 0 deletions clients/client-dynamodb/src/commands/CreateTableCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ export interface CreateTableCommandOutput extends CreateTableOutput, __MetadataB
* ReadCapacityUnits: Number("long"), // required
* WriteCapacityUnits: Number("long"), // required
* },
* OnDemandThroughput: { // OnDemandThroughput
* MaxReadRequestUnits: Number("long"),
* MaxWriteRequestUnits: Number("long"),
* },
* },
* ],
* BillingMode: "PROVISIONED" || "PAY_PER_REQUEST",
Expand All @@ -121,6 +125,10 @@ export interface CreateTableCommandOutput extends CreateTableOutput, __MetadataB
* TableClass: "STANDARD" || "STANDARD_INFREQUENT_ACCESS",
* DeletionProtectionEnabled: true || false,
* ResourcePolicy: "STRING_VALUE",
* OnDemandThroughput: {
* MaxReadRequestUnits: Number("long"),
* MaxWriteRequestUnits: Number("long"),
* },
* };
* const command = new CreateTableCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -203,6 +211,10 @@ export interface CreateTableCommandOutput extends CreateTableOutput, __MetadataB
* // IndexSizeBytes: Number("long"),
* // ItemCount: Number("long"),
* // IndexArn: "STRING_VALUE",
* // OnDemandThroughput: { // OnDemandThroughput
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // ],
* // StreamSpecification: { // StreamSpecification
Expand All @@ -222,12 +234,18 @@ export interface CreateTableCommandOutput extends CreateTableOutput, __MetadataB
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
* // MaxReadRequestUnits: Number("long"),
* // },
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
* // { // ReplicaGlobalSecondaryIndexDescription
* // IndexName: "STRING_VALUE",
* // ProvisionedThroughputOverride: {
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: {
* // MaxReadRequestUnits: Number("long"),
* // },
* // },
* // ],
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),
Expand Down Expand Up @@ -259,6 +277,10 @@ export interface CreateTableCommandOutput extends CreateTableOutput, __MetadataB
* // LastUpdateDateTime: new Date("TIMESTAMP"),
* // },
* // DeletionProtectionEnabled: true || false,
* // OnDemandThroughput: {
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // };
*
Expand Down
8 changes: 8 additions & 0 deletions clients/client-dynamodb/src/commands/DeleteBackupCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export interface DeleteBackupCommandOutput extends DeleteBackupOutput, __Metadat
* // ReadCapacityUnits: Number("long"), // required
* // WriteCapacityUnits: Number("long"), // required
* // },
* // OnDemandThroughput: { // OnDemandThroughput
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // ItemCount: Number("long"),
* // BillingMode: "PROVISIONED" || "PAY_PER_REQUEST",
* // },
Expand Down Expand Up @@ -108,6 +112,10 @@ export interface DeleteBackupCommandOutput extends DeleteBackupOutput, __Metadat
* // ReadCapacityUnits: Number("long"), // required
* // WriteCapacityUnits: Number("long"), // required
* // },
* // OnDemandThroughput: {
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // ],
* // StreamDescription: { // StreamSpecification
Expand Down
14 changes: 14 additions & 0 deletions clients/client-dynamodb/src/commands/DeleteTableCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ export interface DeleteTableCommandOutput extends DeleteTableOutput, __MetadataB
* // IndexSizeBytes: Number("long"),
* // ItemCount: Number("long"),
* // IndexArn: "STRING_VALUE",
* // OnDemandThroughput: { // OnDemandThroughput
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // ],
* // StreamSpecification: { // StreamSpecification
Expand All @@ -159,12 +163,18 @@ export interface DeleteTableCommandOutput extends DeleteTableOutput, __MetadataB
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
* // MaxReadRequestUnits: Number("long"),
* // },
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
* // { // ReplicaGlobalSecondaryIndexDescription
* // IndexName: "STRING_VALUE",
* // ProvisionedThroughputOverride: {
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: {
* // MaxReadRequestUnits: Number("long"),
* // },
* // },
* // ],
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),
Expand Down Expand Up @@ -196,6 +206,10 @@ export interface DeleteTableCommandOutput extends DeleteTableOutput, __MetadataB
* // LastUpdateDateTime: new Date("TIMESTAMP"),
* // },
* // DeletionProtectionEnabled: true || false,
* // OnDemandThroughput: {
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // };
*
Expand Down
8 changes: 8 additions & 0 deletions clients/client-dynamodb/src/commands/DescribeBackupCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export interface DescribeBackupCommandOutput extends DescribeBackupOutput, __Met
* // ReadCapacityUnits: Number("long"), // required
* // WriteCapacityUnits: Number("long"), // required
* // },
* // OnDemandThroughput: { // OnDemandThroughput
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // ItemCount: Number("long"),
* // BillingMode: "PROVISIONED" || "PAY_PER_REQUEST",
* // },
Expand Down Expand Up @@ -108,6 +112,10 @@ export interface DescribeBackupCommandOutput extends DescribeBackupOutput, __Met
* // ReadCapacityUnits: Number("long"), // required
* // WriteCapacityUnits: Number("long"), // required
* // },
* // OnDemandThroughput: {
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // ],
* // StreamDescription: { // StreamSpecification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,18 @@ export interface DescribeGlobalTableCommandOutput extends DescribeGlobalTableOut
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
* // MaxReadRequestUnits: Number("long"),
* // },
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
* // { // ReplicaGlobalSecondaryIndexDescription
* // IndexName: "STRING_VALUE",
* // ProvisionedThroughputOverride: {
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: {
* // MaxReadRequestUnits: Number("long"),
* // },
* // },
* // ],
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),
Expand Down
8 changes: 8 additions & 0 deletions clients/client-dynamodb/src/commands/DescribeImportCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ export interface DescribeImportCommandOutput extends DescribeImportOutput, __Met
* // ReadCapacityUnits: Number("long"), // required
* // WriteCapacityUnits: Number("long"), // required
* // },
* // OnDemandThroughput: { // OnDemandThroughput
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // SSESpecification: { // SSESpecification
* // Enabled: true || false,
* // SSEType: "AES256" || "KMS",
Expand All @@ -106,6 +110,10 @@ export interface DescribeImportCommandOutput extends DescribeImportOutput, __Met
* // ReadCapacityUnits: Number("long"), // required
* // WriteCapacityUnits: Number("long"), // required
* // },
* // OnDemandThroughput: {
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // ],
* // },
Expand Down
14 changes: 14 additions & 0 deletions clients/client-dynamodb/src/commands/DescribeTableCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ export interface DescribeTableCommandOutput extends DescribeTableOutput, __Metad
* // IndexSizeBytes: Number("long"),
* // ItemCount: Number("long"),
* // IndexArn: "STRING_VALUE",
* // OnDemandThroughput: { // OnDemandThroughput
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // ],
* // StreamSpecification: { // StreamSpecification
Expand All @@ -151,12 +155,18 @@ export interface DescribeTableCommandOutput extends DescribeTableOutput, __Metad
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
* // MaxReadRequestUnits: Number("long"),
* // },
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
* // { // ReplicaGlobalSecondaryIndexDescription
* // IndexName: "STRING_VALUE",
* // ProvisionedThroughputOverride: {
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: {
* // MaxReadRequestUnits: Number("long"),
* // },
* // },
* // ],
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),
Expand Down Expand Up @@ -188,6 +198,10 @@ export interface DescribeTableCommandOutput extends DescribeTableOutput, __Metad
* // LastUpdateDateTime: new Date("TIMESTAMP"),
* // },
* // DeletionProtectionEnabled: true || false,
* // OnDemandThroughput: {
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface GetResourcePolicyCommandOutput extends GetResourcePolicyOutput,
* </li>
* </ul>
* <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>
* <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>
* <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>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
16 changes: 16 additions & 0 deletions clients/client-dynamodb/src/commands/ImportTableCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export interface ImportTableCommandOutput extends ImportTableOutput, __MetadataB
* ReadCapacityUnits: Number("long"), // required
* WriteCapacityUnits: Number("long"), // required
* },
* OnDemandThroughput: { // OnDemandThroughput
* MaxReadRequestUnits: Number("long"),
* MaxWriteRequestUnits: Number("long"),
* },
* SSESpecification: { // SSESpecification
* Enabled: true || false,
* SSEType: "AES256" || "KMS",
Expand All @@ -94,6 +98,10 @@ export interface ImportTableCommandOutput extends ImportTableOutput, __MetadataB
* ReadCapacityUnits: Number("long"), // required
* WriteCapacityUnits: Number("long"), // required
* },
* OnDemandThroughput: {
* MaxReadRequestUnits: Number("long"),
* MaxWriteRequestUnits: Number("long"),
* },
* },
* ],
* },
Expand Down Expand Up @@ -143,6 +151,10 @@ export interface ImportTableCommandOutput extends ImportTableOutput, __MetadataB
* // ReadCapacityUnits: Number("long"), // required
* // WriteCapacityUnits: Number("long"), // required
* // },
* // OnDemandThroughput: { // OnDemandThroughput
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // SSESpecification: { // SSESpecification
* // Enabled: true || false,
* // SSEType: "AES256" || "KMS",
Expand All @@ -167,6 +179,10 @@ export interface ImportTableCommandOutput extends ImportTableOutput, __MetadataB
* // ReadCapacityUnits: Number("long"), // required
* // WriteCapacityUnits: Number("long"), // required
* // },
* // OnDemandThroughput: {
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // ],
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface PutResourcePolicyCommandOutput extends PutResourcePolicyOutput,
* <i>eventually consistent</i>
* </a>.</p>
* <p>
* <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>
* <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>
* <note>
* <p>
* <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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export interface RestoreTableFromBackupCommandOutput extends RestoreTableFromBac
* ReadCapacityUnits: Number("long"), // required
* WriteCapacityUnits: Number("long"), // required
* },
* OnDemandThroughput: { // OnDemandThroughput
* MaxReadRequestUnits: Number("long"),
* MaxWriteRequestUnits: Number("long"),
* },
* },
* ],
* LocalSecondaryIndexOverride: [ // LocalSecondaryIndexList
Expand All @@ -104,6 +108,10 @@ export interface RestoreTableFromBackupCommandOutput extends RestoreTableFromBac
* ReadCapacityUnits: Number("long"), // required
* WriteCapacityUnits: Number("long"), // required
* },
* OnDemandThroughputOverride: {
* MaxReadRequestUnits: Number("long"),
* MaxWriteRequestUnits: Number("long"),
* },
* SSESpecificationOverride: { // SSESpecification
* Enabled: true || false,
* SSEType: "AES256" || "KMS",
Expand Down Expand Up @@ -191,6 +199,10 @@ export interface RestoreTableFromBackupCommandOutput extends RestoreTableFromBac
* // IndexSizeBytes: Number("long"),
* // ItemCount: Number("long"),
* // IndexArn: "STRING_VALUE",
* // OnDemandThroughput: { // OnDemandThroughput
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // ],
* // StreamSpecification: { // StreamSpecification
Expand All @@ -210,12 +222,18 @@ export interface RestoreTableFromBackupCommandOutput extends RestoreTableFromBac
* // ProvisionedThroughputOverride: { // ProvisionedThroughputOverride
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: { // OnDemandThroughputOverride
* // MaxReadRequestUnits: Number("long"),
* // },
* // GlobalSecondaryIndexes: [ // ReplicaGlobalSecondaryIndexDescriptionList
* // { // ReplicaGlobalSecondaryIndexDescription
* // IndexName: "STRING_VALUE",
* // ProvisionedThroughputOverride: {
* // ReadCapacityUnits: Number("long"),
* // },
* // OnDemandThroughputOverride: {
* // MaxReadRequestUnits: Number("long"),
* // },
* // },
* // ],
* // ReplicaInaccessibleDateTime: new Date("TIMESTAMP"),
Expand Down Expand Up @@ -247,6 +265,10 @@ export interface RestoreTableFromBackupCommandOutput extends RestoreTableFromBac
* // LastUpdateDateTime: new Date("TIMESTAMP"),
* // },
* // DeletionProtectionEnabled: true || false,
* // OnDemandThroughput: {
* // MaxReadRequestUnits: Number("long"),
* // MaxWriteRequestUnits: Number("long"),
* // },
* // },
* // };
*
Expand Down
Loading

0 comments on commit 7a4330d

Please sign in to comment.