Updating a table using the AWS SDK for .Net
Now, let's understand how to update a DynamoDB table using the AWS SDK for .Net.
Getting ready
You can use the IDE of your choice to code these recipes.
How to do it…
In this recipe, we will learn how to update the provisioned capacity of the already created table using the AWS SDK for .Net:
- Create an
update table
request and provide the new read and write capacity units:AmazonDynamoDBClient client = new AmazonDynamoDBClient(); string tableName = "productTableNet"; var request=new UpdateTableRequest(){ TableName=tableName, ProvisionedThroughput = new ProvisionedThroughput(){ ReadCapacityUnits=2, WriteCapacityUnits=2 } };
- Invoke the
updateTable
method from the DynamoDB client to update the table with the provided capacity units:var response = client.UpdateTable(request);
- It takes some time for DynamoDB to make the changes effective. So, it's always a best practice to wait until the table becomes active again...