Skip to content

fix: Require ProvisionedThroughput when DynamoDB BillingMode is omitted - #4702

Merged
kddejong merged 1 commit into
aws-cloudformation:mainfrom
kddejong:fix/issue/4651
Sep 10, 2026
Merged

kddejong merged 1 commit into
aws-cloudformation:mainfrom
kddejong:fix/issue/4651

Conversation

@kddejong

Copy link
Copy Markdown
Contributor

Fixes #4651

Problem

A AWS::DynamoDB::Table with neither BillingMode nor ProvisionedThroughput fails to deploy with Property ProvisionedThroughput cannot be empty, because the default BillingMode is PROVISIONED (which requires ProvisionedThroughput). cfn-lint reported nothing.

E3639's billingmode_provisioned_dependent extension only required ProvisionedThroughput when BillingMode was explicitly PROVISIONED (if required BillingMode present + const: PROVISIONED), so the omitted-default case slipped through.

Fix

Change the if to match when BillingMode is anything other than PAY_PER_REQUEST (not const PAY_PER_REQUEST). This matches both an explicit PROVISIONED and an omitted BillingMode, so ProvisionedThroughput is now required in both. PAY_PER_REQUEST is unaffected (and the separate billingmode_exclusive extension still enforces RCU/WCU 0 there).

Behavior after fix

BillingMode ProvisionedThroughput Result
omitted missing E3639 (new)
PROVISIONED missing E3639
omitted / PROVISIONED present clean
PAY_PER_REQUEST missing clean

Testing

  • Added unit cases for omitted BillingMode (with and without ProvisionedThroughput).
  • Updated good/resources/dynamodb/attributes_transform.yaml (three tables that had neither field — actually invalid) to PAY_PER_REQUEST.
  • Repro template from the issue now reports E3639; full unit rule suite passes; no other fixtures newly flagged.

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

codecov Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.66%. Comparing base (5caad1e) to head (aeec851).

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           
Flag Coverage Δ
unittests 94.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kddejong
kddejong merged commit 7b49165 into aws-cloudformation:main Sep 10, 2026
22 checks passed
@kddejong
kddejong deleted the fix/issue/4651 branch September 10, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Property ProvisionedThroughput cannot be empty

1 participant