Skip to content

fix(dynamodb): set top-level SSESpecification on TableV2MultiAccountReplica - #38860

Open
hdp01 wants to merge 1 commit into
aws:mainfrom
hdp01:fix/37783-replica-sse
Open

hdp01 wants to merge 1 commit into
aws:mainfrom
hdp01:fix/37783-replica-sse

Conversation

@hdp01

@hdp01 hdp01 commented Sep 21, 2026

Copy link
Copy Markdown

Fixes #37783.

TableV2MultiAccountReplica rendered replica-level SSESpecification.KMSMasterKeyId but omitted the top-level SSESpecification on AWS::DynamoDB::GlobalTable, which CloudFormation reads as SSE disabled and rejects when replicas carry KMS keys (ReplicaSSESpecification and SSEType must be null when SSE is set to default).

One-line fix in packages/aws-cdk-lib/aws-dynamodb/lib/table-v2.ts, mirroring TableV2 (which always renders encryption._renderSseSpecification()): render the top-level spec from props.encryption. Per-type behavior is unchanged and matches TableV2dynamoOwnedKey() renders {sseEnabled: false}, awsManagedKey()/customerManagedKey() render {sseEnabled: true, sseType: 'KMS'}.

Extended the existing TableV2MultiAccountReplica with custom encryption test to assert the top-level SSEEnabled/SSEType alongside the replica KMSMasterKeyId.

Note: could not run the package suite locally — a fresh clone needs the full monorepo bootstrap (cdk-build-tools + codegen) before jest resolves generated modules, which exceeds this environment. The change mirrors the established TableV2 pattern line-for-line; leaving full verification to CI.

…eplica (aws#37783)

TableV2MultiAccountReplica rendered replica-level SSE info but omitted
the top-level SSESpecification on AWS::DynamoDB::GlobalTable, which CFN
reads as SSE disabled and rejects when replicas carry KMS keys. Mirrors
TableV2, which always renders encryption._renderSseSpecification().

Extends the existing custom-encryption test to assert top-level
SSEEnabled/SSEType alongside the replica KMSMasterKeyId.
@hdp01
hdp01 deployed to automation September 21, 2026 05:03 — with GitHub Actions Active
@hdp01
hdp01 deployed to automation September 21, 2026 05:03 — with GitHub Actions Active
@github-actions github-actions Bot added bug This issue is a bug. effort/small Small work item – less than a day of effort beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 labels Sep 21, 2026
@aws-cdk-automation
aws-cdk-automation requested a review from a team September 21, 2026 05:03
@hdp01
hdp01 deployed to automation September 21, 2026 05:03 — with GitHub Actions Active

@aws-cdk-automation aws-cdk-automation left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

✅ A exemption request has been requested. Please wait for a maintainer's review.

@hdp01

hdp01 commented Sep 21, 2026

Copy link
Copy Markdown
Author

Exemption Request: integration test + snapshot for this fix.

Justification:

  • The change is a 1-line CloudFormation template rendering fix (sseSpecification on CfnGlobalTable), covered by an extended unit assertion (TableV2MultiAccountReplica with custom encryption now checks top-level SSEEnabled/SSEType alongside the replica key) — the same level at which TableV2's own SSE rendering is tested.
  • A meaningful integ test would require a real two-account deployment (source table in one account/region, replica in another with KMS keys in both) — not runnable in standard CI and disproportionate here. There is no existing integ coverage for global tables or multi-account replicas in aws-dynamodb/test/ (only integ.autoscaling.lit.ts), so there is no snapshot pattern to extend.
  • Risk of the template change regressing silently is guarded by the unit test above, which fails without the fix and passes with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/small Small work item – less than a day of effort p2 pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TableV2MultiAccountReplica: does not set top-level SSESpecification when using TableEncryptionV2.customerManagedKey(), causing deployment failure

2 participants