AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
You can only perform one of the following operations at once:
Modify the provisioned throughput settings of the table.
Enable or disable Streams on the table.
Remove a global secondary index from the table.
Create a new global secondary index on the table. Once the index begins backfilling, you can use UpdateTable to perform other operations.
UpdateTable is an asynchronous operation; while it is executing, the table
status changes from ACTIVE to UPDATING. While it is UPDATING,
you cannot issue another UpdateTable request. When the table returns to the
ACTIVE state, the UpdateTable operation is complete.
Namespace: Amazon.DynamoDBv2.Model
Assembly: AWSSDK.dll
Version: (assembly version)
public class UpdateTableRequest : AmazonDynamoDBRequest IRequestEvents
The UpdateTableRequest type exposes the following members
| Name | Description | |
|---|---|---|
|
UpdateTableRequest() | Empty constructor used to set properties independently even when a simple constructor is available |
|
UpdateTableRequest(string, ProvisionedThroughput) | Instantiates UpdateTableRequest with the parameterized properties |
| Name | Type | Description | |
|---|---|---|---|
|
AttributeDefinitions | System.Collections.Generic.List<Amazon.DynamoDBv2.Model.AttributeDefinition> |
Gets and sets the property AttributeDefinitions.
An array of attributes that describe the key schema for the table and indexes. If you are adding a new global secondary index to the table, AttributeDefinitions must include the key element(s) of the new index. |
|
GlobalSecondaryIndexUpdates | System.Collections.Generic.List<Amazon.DynamoDBv2.Model.GlobalSecondaryIndexUpdate> |
Gets and sets the property GlobalSecondaryIndexUpdates.
An array of one or more global secondary indexes for the table. For each index in the array, you can request one action:
For more information, see Managing Global Secondary Indexes in the Amazon DynamoDB Developer Guide. |
|
ProvisionedThroughput | Amazon.DynamoDBv2.Model.ProvisionedThroughput | Gets and sets the property ProvisionedThroughput. |
|
StreamSpecification | Amazon.DynamoDBv2.Model.StreamSpecification |
Gets and sets the property StreamSpecification.
Represents the DynamoDB Streams configuration for the table. You will receive a ResourceInUseException if you attempt to enable a stream on a table that already has a stream, or if you attempt to disable a stream on a table which does not have a stream. |
|
TableName | System.String |
Gets and sets the property TableName.
The name of the table to be updated. |
This example shows how to update the throughput settings of a table. New throughput will be 40 ReadCapacityUnits and 50 WriteCapacityUnits.
// Create a client
AmazonDynamoDBClient client = new AmazonDynamoDBClient();
// Define new table throughput:
// Table will now have capacity of 40 reads and 50 writes
ProvisionedThroughput throughput = new ProvisionedThroughput
{
ReadCapacityUnits = 40,
WriteCapacityUnits = 50
};
// Compose the UpdateTable request
UpdateTableRequest request = new UpdateTableRequest
{
TableName = "SampleTable",
ProvisionedThroughput = throughput
};
// View new table properties
TableDescription tableDescription = client.UpdateTable(request).TableDescription;
Console.WriteLine("Table name: {0}", tableDescription.TableName);
Console.WriteLine("Throughput: Reads = {0}, Writes = {1}",
tableDescription.ProvisionedThroughput.ReadCapacityUnits,
tableDescription.ProvisionedThroughput.WriteCapacityUnits);
.NET Framework:
Supported in: 4.5, 4.0, 3.5
.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8
.NET for Windows Phone:
Supported in: Windows Phone 8.1, Windows Phone 8