fix(dynamodb): propagate billing-mode changes through GSIs#400
Merged
vieiralucas merged 1 commit intomainfrom Apr 15, 2026
Merged
fix(dynamodb): propagate billing-mode changes through GSIs#400vieiralucas merged 1 commit intomainfrom
vieiralucas merged 1 commit intomainfrom
Conversation
DynamoDB's UpdateTable zeroes every GSI's ProvisionedThroughput when a
table flips to PAY_PER_REQUEST, and CreateTable returns {0, 0} for GSIs
on PAY_PER_REQUEST tables regardless of whether the caller sent a
ProvisionedThroughput block. fakecloud previously left stale capacity
numbers on GSIs, defaulted missing throughput to {5, 5}, and dropped
AttributeDefinitions sent alongside a GSI Create op. The Terraform
provider's post-apply refresh plan then reported drift, blocking four
upstream TestAcc tests.
- parse_gsi / CreateTable: zero GSI ProvisionedThroughput when billing
mode is PAY_PER_REQUEST; keep {5, 5} default only for PROVISIONED.
- UpdateTable: on PROVISIONED -> PAY_PER_REQUEST transition, zero the
table and every GSI's throughput before applying index updates.
- UpdateTable GSI Create op: pick throughput based on the table's
current billing mode, matching real AWS semantics.
- UpdateTable: merge new AttributeDefinitions into the table schema so
a follow-up DescribeTable reflects GSI hash/range keys that were
added alongside the Create op.
Removes the four upstream tests from the DynamoDB deny list and adds
three e2e regression tests covering create + update paths.
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
DynamoDB's UpdateTable zeroes every GSI's ProvisionedThroughput when a table flips to PAY_PER_REQUEST, and CreateTable returns
{0, 0}for GSIs on PAY_PER_REQUEST tables regardless of whether the caller sent a ProvisionedThroughput block. fakecloud previously left stale capacity numbers on GSIs, defaulted missing throughput to{5, 5}, and dropped AttributeDefinitions sent alongside a GSI Create op. The Terraform provider's post-apply refresh plan then reported drift, which blocked four upstream TestAcc tests behind the "billing-mode transitions with GSI" gap.Fix:
parse_gsi/ CreateTable: zero GSI ProvisionedThroughput when billing mode is PAY_PER_REQUEST; keep{5, 5}default only for PROVISIONED.Removes these four entries from the DynamoDB tfacc deny list:
Test plan
crates/fakecloud-e2e/tests/dynamodb.rscover create + update paths (dynamodb_create_pay_per_request_with_gsi_zeroes_throughput,dynamodb_update_table_provisioned_to_pay_per_request_zeroes_gsi,dynamodb_update_table_gsi_create_on_pay_per_request_zeroes_throughput).cargo test -p fakecloud-e2e --test dynamodbpasses (41/41).cargo test -p fakecloud-conformance --test dynamodbpasses (30/30).TestAccDynamoDBTable_BillingMode*tests pass locally against fakecloud viago test ./internal/service/dynamodb/ -run ....cargo clippy --workspace --all-targets -- -D warningsclean.Summary by cubic
Fixes DynamoDB billing-mode transitions so GSIs and table throughput follow AWS semantics, preventing Terraform drift. Unblocks four upstream
TestAccDynamoDBTable_BillingMode*tests.fakecloud-e2eand removed 4 denylist entries infakecloud-tfacc.Written for commit 479ce56. Summary will update on new commits.