feat(dynamodb): process GlobalSecondaryIndexUpdates in UpdateTable#387
Merged
vieiralucas merged 1 commit intomainfrom Apr 14, 2026
Merged
feat(dynamodb): process GlobalSecondaryIndexUpdates in UpdateTable#387vieiralucas merged 1 commit intomainfrom
vieiralucas merged 1 commit intomainfrom
Conversation
Real AWS DynamoDB UpdateTable accepts a GlobalSecondaryIndexUpdates list with three op types — Create, Update, Delete — to manage GSIs across the table's lifetime. fakecloud was silently ignoring the entire list, which broke any Terraform aws_dynamodb_table workflow that mutated GSI capacity, projection, or membership after create. This commit implements all three op types in fakecloud's UpdateTable: - Create: add a new GSI from the supplied KeySchema, Projection, and ProvisionedThroughput. Replaces any existing GSI with the same name. - Update: change ProvisionedThroughput on an existing GSI by name. - Delete: drop a GSI by name. Closes the TestAccDynamoDBTable_gsiUpdateCapacity gap; removes it from the tfacc deny-list. The other GSI gap entries (BillingMode transitions, on-demand throughput) need separate fakecloud work and stay denied. New e2e test dynamodb_update_table_processes_global_secondary_index_updates covers the Update path end-to-end.
There was a problem hiding this comment.
1 issue found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="crates/fakecloud-dynamodb/src/service/tables.rs">
<violation number="1" location="crates/fakecloud-dynamodb/src/service/tables.rs:365">
P2: Do not swallow `KeySchema` parse errors when creating a GSI; this currently accepts invalid input and creates malformed index state.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| Some(n) => n.to_string(), | ||
| None => continue, | ||
| }; | ||
| let key_schema = parse_key_schema(&create["KeySchema"]).unwrap_or_default(); |
There was a problem hiding this comment.
P2: Do not swallow KeySchema parse errors when creating a GSI; this currently accepts invalid input and creates malformed index state.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At crates/fakecloud-dynamodb/src/service/tables.rs, line 365:
<comment>Do not swallow `KeySchema` parse errors when creating a GSI; this currently accepts invalid input and creates malformed index state.</comment>
<file context>
@@ -346,6 +349,52 @@ impl DynamoDbService {
+ Some(n) => n.to_string(),
+ None => continue,
+ };
+ let key_schema = parse_key_schema(&create["KeySchema"]).unwrap_or_default();
+ let projection = parse_projection(&create["Projection"]);
+ let provisioned_throughput =
</file context>
Suggested change
| let key_schema = parse_key_schema(&create["KeySchema"]).unwrap_or_default(); | |
| let key_schema = parse_key_schema(&create["KeySchema"])?; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Batch 12 — second batch driving the DynamoDB tfacc deny-list down. Implements GSI lifecycle ops on `UpdateTable`.
Real AWS DynamoDB `UpdateTable` accepts a `GlobalSecondaryIndexUpdates` list with three op types — `Create`, `Update`, `Delete` — to manage GSIs across the table's lifetime. fakecloud was silently ignoring the entire list, which broke any Terraform `aws_dynamodb_table` workflow that mutated GSI capacity, projection, or membership after create.
Closes the `TestAccDynamoDBTable_gsiUpdateCapacity` gap; removes it from the tfacc deny-list. The other GSI gap entries (BillingMode transitions, on-demand throughput) need separate fakecloud work and stay denied.
Test plan
Summary by cubic
Adds full
GlobalSecondaryIndexUpdatessupport to DynamoDBUpdateTable, matching AWS behavior for GSI create, update, and delete. This unblocks Terraformaws_dynamodb_tableGSI lifecycle updates and removesTestAccDynamoDBTable_gsiUpdateCapacityfrom thefakecloud-tfaccdeny-list.UpdateTable(fakecloud-dynamodb).parse_projectionfor GSI Create logic.dynamodb_update_table_processes_global_secondary_index_updates(fakecloud-e2e) and updatedfakecloud-tfacc/allowlist.rs.Written for commit d4b1d7e. Summary will update on new commits.