Skip to content

fix(dynamodb): remove deprecated tablegrants props from tablev2 - #38184

Open
josemfche wants to merge 4 commits into
aws:mainfrom
josemfche:fix/dynamodb-tablev2-tablegrants-deprecation-warnings
Open

fix(dynamodb): remove deprecated tablegrants props from tablev2#38184
josemfche wants to merge 4 commits into
aws:mainfrom
josemfche:fix/dynamodb-tablev2-tablegrants-deprecation-warnings

Conversation

@josemfche

Copy link
Copy Markdown

Fixes #37221

Summary

Removes deprecated encryptedResource and policyResource props from TableGrants initialization in TableV2 and TableV2MultiAccountReplica. TableGrants already auto-discovers encryption keys and resource policies via EncryptedResources.of() / ResourceWithPolicies.of() when those props are omitted.

This stops JSII deprecation warnings triggered by the "encryptedResource" in p check even when the values are undefined.

Test plan

  • Added regression tests in table-v2-base.test.ts covering:
    • JSII compiled path does not pass deprecated props
    • Explicit deprecated props still warn (control test)
    • DynamoEventSource stream grants preserved
    • CMK-encrypted table grantReadData still grants KMS via auto-discovery
  • yarn test aws-dynamodb/test/ --coverage=false — 413/413 passed

Made with Cursor

Fixes aws#37221

Remove deprecated encryptedResource and policyResource from TableGrants initialization in TableV2 and TableV2MultiAccountReplica. TableGrants already auto-discovers encryption keys and resource policies when omitted.

Add regression tests for the jsii compiled path and DynamoEventSource grant behavior.
@github-actions github-actions Bot added 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 labels Jun 20, 2026

@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.

(This review is outdated)

Add integ test covering TableV2 with DynamoEventSource to satisfy PR linter for Fixes aws#37221.
@josemfche

Copy link
Copy Markdown
Author

Integration snapshot note for maintainers:

The integ.dynamodb-table-v2 snapshot was generated locally with yarn integ --dry-run --force because this account is not CDK-bootstrapped for live deploy. There is no expected CloudFormation output change from this PR (deprecation warning removal only).

When adding pr/needs-integration-tests-deployment, please regenerate the snapshot via the normal deploy workflow if preferred:

cd packages/@aws-cdk-testing/framework-integ
yarn integ --force aws-lambda-event-sources/test/integ.dynamodb-table-v2.js

Local snapshot verification passes (yarn integ aws-lambda-event-sources/test/integ.dynamodb-table-v2.js → UNCHANGED).

@aws-cdk-automation

Copy link
Copy Markdown
Collaborator

This PR has been in the MERGE CONFLICTS state for 3 weeks, and looks abandoned. Note that PRs with failing linting check or builds are not reviewed, please ensure your build is passing

To prevent automatic closure:

  • Resume work on the PR
  • OR request an exemption by adding a comment containing 'Exemption Request' with justification e.x "Exemption Request: "
  • OR request clarification by adding a comment containing 'Clarification Request' with a question e.x "Clarification Request: "

This PR will automatically close in 14 days if no action is taken.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-dynamodb: TableV2 with DynamoEventSource triggers deprecated TableGrantsProps#policyResource and #encryptedResource warnings during synth

3 participants