2

I am try to add an index in DynamoDB table having size around 200MB.

its took almost 15 hours and is still running. I have checked that i have given the low read/write IOPS for index. Now i want to increase IOPS and restart the index creation activity.

Any idea - If its possible to cancel the current operation ?

Thanks

Aman Aggarwal
  • 17,619
  • 9
  • 53
  • 81

2 Answers2

4

https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html

You cannot cancel an in-flight global secondary index creation.

But on the plus side you are incorrect that you need to cancel the operation to change the throughput capacity.

If the provisioned write throughput setting on the index is too low, the index build will take longer to complete. To shorten the time it takes to build a new global secondary index, you can increase its provisioned write capacity temporarily.

EDIT:

After the index has been created, you should set its provisioned write capacity to reflect the normal usage of your application.

F_SO_K
  • 13,640
  • 5
  • 54
  • 83
1

You can adjust the read capacity units and write capacity units values of a currently running index creation using the AWS CLI:

Create a file named gsi-update-MyIndex.json with the following content:

[
  {
    "Update": {
      "IndexName": "BluekaiID-index",
      "ProvisionedThroughput": {
        "ReadCapacityUnits": 1,
        "WriteCapacityUnits": 100
      }
    }
  }
]

Then, execute the following command:

aws dynamodb update-table --table-name mytablename --global-secondary-index-updates file://gsi-update-MyIndex.json

You'll probably want to bump up the values on the main table for a minute, too with the following command:

aws dynamodb update-table --table-name mytablename --provisioned-throughput ReadCapacityUnits=100,WriteCapacityUnits=1

Once your index creation is done and loaded, rerun the commands above with smaller values to fit your normal traffic.