Local secondary indexes must be specified at table creation
TL;DR — A local secondary index (LSI) can only be created at the moment its table is created; it cannot be added, changed, or removed afterward. UpdateTable has no operation for LSIs, so any attempt to add one to a live table fails validation. To get a new LSI you must create a new table (with the LSI) and migrate the data — or use a global secondary index (GSI), which can be added online.
What it means
ValidationException: One or more parameter values were invalid: Local secondary
indexes can only be created when a table is createdAn LSI shares its partition key with the base table and adds an alternate sort key; DynamoDB co-locates it with the item's partition at write time. Because of that physical coupling, an LSI must exist from the table's first write — UpdateTable supports adding/removing GSIs but has no LSI parameter at all, so there is no request you could even send to retrofit one. The exact message varies by path (an SDK/CLI call may fail parameter validation client-side; IaC tools surface their own wording), but the service-side form is an HTTP 400 ValidationException and it is not retryable: the operation simply isn't supported on an existing table.
Why it happens
- Adding an LSI to a live table — calling
UpdateTable(or editing a CloudFormation/Terraform template) to introduce a newLocalSecondaryIndexesentry on a table that already exists. - Changing an existing LSI — its key schema or projection is fixed at creation; edits are rejected.
- An IaC diff that recreates vs. updates — the tool tries to update-in-place an LSI change that DynamoDB only allows at create time.
How to fix it
- Create a new table with the LSI defined up front, then migrate data (scan-and-write, or an on-demand export/import).
- Use a GSI instead if the access pattern allows it — GSIs can be added to an existing table online and don't require the same partition key:
aws dynamodb update-table --table-name <Table> \ --attribute-definitions AttributeName=gsi_sk,AttributeType=S \ --global-secondary-index-updates '[{"Create":{"IndexName":"gsi1", ...}}]' - Plan LSIs during modeling — decide alternate sort keys before the table exists, since they can't be retrofitted.
- Model the access pattern in a GSI first. If the query works on a GSI with a different partition key, you avoid a table rebuild entirely.
Check size in DynoTable
Before you rebuild a table for an LSI, validate the access pattern in DynoTable — open the table with ⌘K and test whether a GSI query covers the same need. The Query Builder generates the KeyConditionExpression your new index must serve.
Use the pricing calculator to compare LSI write amplification against a GSI alternative. Switch profiles with ⌘P; see Connect to AWS and Install.
Sources
- Local secondary indexes (verified 2026-07-13)
- UpdateTable — Amazon DynamoDB API Reference (verified 2026-07-13)
Related errors
- Attempting to modify a GSI that is being created — a GSI change blocked while the index builds.
- Requested resource not found / index not found — querying an index name that doesn't exist.
- ValidationException (overview)
- Learn: GSI vs LSI · Indexes overview
References
- Local secondary indexes — Amazon DynamoDB Developer Guide
- UpdateTable — Amazon DynamoDB API Reference
- Quotas in Amazon DynamoDB — Amazon DynamoDB Developer Guide
Last verified 2026-07-13 against the official AWS documentation linked above.