Skip to content

feat(dynamodb): resource policies for streams#37254

Merged
mergify[bot] merged 2 commits into
aws:mainfrom
LeeroyHannigan:lhnng-stream-rbp
May 11, 2026
Merged

feat(dynamodb): resource policies for streams#37254
mergify[bot] merged 2 commits into
aws:mainfrom
LeeroyHannigan:lhnng-stream-rbp

Conversation

@LeeroyHannigan
Copy link
Copy Markdown
Contributor

Issue # (if applicable)

Closes NA

Reason for this change

The CloudFormation AWS::DynamoDB::GlobalTable L1 resource supports ReplicaStreamSpecification.ResourcePolicy on each replica, allowing users to attach resource-based policies to DynamoDB Streams. However, the TableV2 L2 construct does not expose this property, making it impossible to set a stream resource policy without escape hatches — which get
overwritten during synthesis.

Description of changes

Added streamResourcePolicy support to the DynamoDB TableV2 L2 construct:

  • Added streamResourcePolicy property to TableOptionsV2 interface, which flows to both ReplicaTableProps and TableV2MultiAccountReplicaProps
  • Added streamResourcePolicy field to TableV2 and TableV2MultiAccountReplica, initialized from props
  • Added addToStreamResourcePolicy() method to both TableV2 and TableV2MultiAccountReplica for imperative policy construction
  • Wired replicaStreamSpecification rendering in configureReplicaTable() via a new renderReplicaStreamSpecification() helper — primary region uses this.streamResourcePolicy,
    replica regions use props.streamResourcePolicy
  • Wired replicaStreamSpecification rendering in TableV2MultiAccountReplica using Lazy.any to support imperative additions
  • Updated README with documentation and examples

Describe any new or updated permissions being added

No new IAM permissions are introduced. This change allows users to configure resource-based policies on DynamoDB Streams, which is an existing DynamoDB capability that was not previously exposed in the L2 construct.

Description of how you validated changes

  • Unit tests: 4 new tests in table-v2.test.ts covering stream resource policy via props on primary table, via props on replica, via addToStreamResourcePolicy(), and absent by default
  • Integration test: integ.dynamodb-v2.stream-resource-policy.ts covering declarative (props) and imperative (addToStreamResourcePolicy) usage with replicas

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions Bot added the p2 label Mar 15, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team March 15, 2026 18:17
@github-actions github-actions Bot added the valued-contributor [Pilot] contributed between 6-12 PRs to the CDK label Mar 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 15, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.
To suppress a specific rule, see Suppressing Rules.


TestsPassed ✅SkippedFailed
Security Guardian Results48 ran48 passed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 15, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.
To suppress a specific rule, see Suppressing Rules.


TestsPassed ✅SkippedFailed
Security Guardian Results with resolved templates48 ran48 passed
TestResult
No test annotations available

@aws-cdk-automation aws-cdk-automation added the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Mar 15, 2026
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 15, 2026
rix0rrr
rix0rrr previously approved these changes Apr 24, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 24, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 24, 2026

Merge Queue Status

  • Entered queue2026-04-24 08:41 UTC · Rule: default-squash
  • 🚫 Left the queue2026-04-24 08:42 UTC · at 533586fb6ae88e53e4e1b35e3bff5b04b23ce392

This pull request spent 7 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/agent-docs-sync-reminder.yml without workflows permission

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 24, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 24, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify Bot dismissed rix0rrr’s stale review May 4, 2026 12:18

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label May 4, 2026
Abogical
Abogical previously approved these changes May 5, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 5, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 5, 2026

Merge Queue Status

  • Entered queue2026-05-05 09:31 UTC · Rule: default-squash
  • 🚫 Left the queue2026-05-05 09:31 UTC · at 71c5b305e8a3507e439dcd2be2093ce5fe57ee40

This pull request spent 8 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/pr-linter.yml without workflows permission

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label May 5, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 5, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify Bot dismissed Abogical’s stale review May 9, 2026 10:08

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label May 9, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 11, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 11, 2026

Merge Queue Status

  • Entered queue2026-05-11 09:48 UTC · Rule: default-squash
  • Checks skipped · PR is already up-to-date
  • Merged2026-05-11 09:48 UTC · at d6e22712a638544dd6170f28a56fb168e70486a4 · squash

This pull request spent 24 seconds in the queue, including 5 seconds running CI.

Required conditions to merge

@mergify mergify Bot merged commit 7e5679c into aws:main May 11, 2026
34 of 35 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 11, 2026
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

p2 pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. valued-contributor [Pilot] contributed between 6-12 PRs to the CDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants