Skip to content

dynamodb: TableV2 grants emit unactionable upstream deprecation warnings #340

Description

@laazyj

Summary

Every synth() that grants against a TableV2 emits two deprecation warnings that consumers cannot act on:

[WARNING] aws-cdk-lib.aws_dynamodb.TableGrantsProps#encryptedResource is deprecated.
  - Leave this field undefined. ... This API will be removed in the next major release.
[WARNING] aws-cdk-lib.aws_dynamodb.TableGrantsProps#policyResource is deprecated.
  - Leave this field undefined. ... This API will be removed in the next major release.

Surfaced while investigating the CI timeouts on #329 (fixed in #337).

It is not our call site

packages/dynamodb/src/grants.ts calls the plain native methods and never passes those props:

read: capability((table, grantee) => {
  table.grantReadData(grantee);
}),

Isolated it to TableV2 specifically, with a script using only aws-cdk-lib and no ComposureCDK:

construct grantReadData grantReadWriteData grantFullAccess
Table (v1) 0 warnings 0 0
TableV2 2 warnings 2 2

So aws-cdk-lib's own TableV2 grant path constructs TableGrants with the deprecated props internally. Reproduced on aws-cdk-lib@2.262.1.

Why it still matters to us

TableV2Builder is shipped library code, so every consumer using tableGrants.* against a v2 table sees these warnings on every synth, with no way to silence them and nothing to fix in their own code. Two of our own examples trigger it: crud-api-app.ts and clean-desk-policy.ts.

The props are marked for removal in the next major, so this should resolve upstream — but it is worth tracking rather than rediscovering.

Suggested actions

  • Confirm against the latest aws-cdk-lib and check whether an upstream issue already exists
  • File upstream if not
  • Decide whether to note it in the dynamodb README so consumers do not chase it

No change to ComposureCDK is indicated today — the call sites are already correct.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions