Repository navigation
fix: Require ProvisionedThroughput when DynamoDB BillingMode is omitted - #4702
Merged
Merged
Conversation
A DynamoDB Table with neither BillingMode nor ProvisionedThroughput
fails to deploy ('Property ProvisionedThroughput cannot be empty')
because the default BillingMode is PROVISIONED. E3639 only required
ProvisionedThroughput when BillingMode was explicitly PROVISIONED, so
the omitted-default case passed silently.
Match the if on 'BillingMode is not PAY_PER_REQUEST' so the requirement
also covers the omitted default. Update the good transform fixture,
which was relying on the gap, to set PAY_PER_REQUEST.
aws-cloudformation#4651
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4702 +/- ##
=======================================
Coverage 94.66% 94.66%
=======================================
Files 434 434
Lines 15561 15561
Branches 3019 3019
=======================================
Hits 14731 14731
Misses 453 453
Partials 377 377
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #4651
Problem
A
AWS::DynamoDB::Tablewith neitherBillingModenorProvisionedThroughputfails to deploy withProperty ProvisionedThroughput cannot be empty, because the defaultBillingModeisPROVISIONED(which requiresProvisionedThroughput). cfn-lint reported nothing.E3639's
billingmode_provisioned_dependentextension only requiredProvisionedThroughputwhenBillingModewas explicitlyPROVISIONED(ifrequiredBillingModepresent +const: PROVISIONED), so the omitted-default case slipped through.Fix
Change the
ifto match whenBillingModeis anything other thanPAY_PER_REQUEST(not const PAY_PER_REQUEST). This matches both an explicitPROVISIONEDand an omittedBillingMode, soProvisionedThroughputis now required in both.PAY_PER_REQUESTis unaffected (and the separatebillingmode_exclusiveextension still enforces RCU/WCU 0 there).Behavior after fix
Testing
BillingMode(with and withoutProvisionedThroughput).good/resources/dynamodb/attributes_transform.yaml(three tables that had neither field — actually invalid) toPAY_PER_REQUEST.