Attempting to modify a GSI that is being created
TL;DR — While a global secondary index is in its build phase (IndexStatus = CREATING), DynamoDB won't let you modify that index, add or delete other indexes, change throughput, or delete the table. Wait until the GSI reaches ACTIVE, and make GSI changes one at a time — you can't create and modify indexes in the same UpdateTable.
What it means
ValidationException: Attempting to modify a GSI that is being createdCreating a GSI on a populated table triggers a backfill — DynamoDB replays existing items into the new index in the background. Throughout that phase the index's IndexStatus is CREATING. During the backfill DynamoDB rejects further structural changes to the index or table so the build stays consistent. It's an HTTP 400 ValidationException; retrying immediately fails until the index finishes.
Why it happens
- Overlapping index operations — an
UpdateTable(or an IaC apply) tries to modify/delete a GSI, or add a second one, while the first is still building. - CloudFormation/Terraform batching — the tool attempts multiple GSI changes in a single update; DynamoDB allows only one GSI create or delete per
UpdateTable. - Throughput change mid-build — trying to adjust provisioned capacity on a table whose GSI is still
CREATING. - Deleting the table too soon — a teardown that races the backfill.
How to fix it
- Wait for
ACTIVE. PollDescribeTableand check eachGlobalSecondaryIndexes[].IndexStatus; only proceed once it'sACTIVE.aws dynamodb describe-table --table-name <Table> \ --query "Table.GlobalSecondaryIndexes[].{Name:IndexName,Status:IndexStatus}" - Sequence index changes — one create/delete per
UpdateTable; don't add a new GSI while another is building. - In CloudFormation/Terraform, split GSI additions across separate deploys so each backfill completes before the next change.
- Defer throughput/table edits on that table until the index is
ACTIVE.
Related errors
- Local secondary indexes must be specified at table creation — the LSI equivalent (LSIs can't be added at all).
- ResourceInUseException — operating on a table/index that isn't in a modifiable state.
- Requested resource not found / index not found — querying an index that isn't ready or doesn't exist.