Skip to content

docs(sns): add IAM action details to grant method docstrings - #37251

Open
tiwari91 wants to merge 3 commits into
aws:mainfrom
tiwari91:fix/35736-sns-grant-docstrings
Open

tiwari91 wants to merge 3 commits into
aws:mainfrom
tiwari91:fix/35736-sns-grant-docstrings

Conversation

@tiwari91

Copy link
Copy Markdown
Contributor

Issue

Closes #35736

Reason for this change

The existing docstrings on grantPublish(), grantSubscribe(), and addSubscription() were too brief — they didn't mention which IAM actions are actually granted or what resources are created. Users had to dig into the source or look up the CloudFormation docs to figure out what these methods do under the hood.

Description of changes

Enhanced JSDoc on both the ITopic interface and the TopicBase implementation:

  • grantPublish(): Now documents that it grants sns:Publish, and when the topic uses a customer-managed KMS key, also grants kms:Decrypt and kms:GenerateDataKey*.
  • grantSubscribe(): Now documents that it grants sns:Subscribe.
  • addSubscription(): Now mentions it creates an AWS::SNS::Subscription resource and that the endpoint/protocol come from the ITopicSubscription implementation.

Description of how you validated changes

All existing SNS tests pass (143 tests, 5 suites). This is a docs-only change with no behavior changes.

Checklist

…d addSubscription docstrings

The existing docstrings didn't mention which IAM actions are granted, making
it hard for users to understand what permissions are being set up. This adds
specific action names (sns:Publish, sns:Subscribe, kms:Decrypt, etc.) and
a brief description of what addSubscription creates.

Closes aws#35736
@github-actions github-actions Bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/small Small work item – less than a day of effort p2 labels Mar 14, 2026
@aws-cdk-automation
aws-cdk-automation requested a review from a team March 14, 2026 19:33
@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 Jul 28, 2026
@aws-cdk-automation aws-cdk-automation added pr/community-review-timeout pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Aug 28, 2026
aemada-aws
aemada-aws previously approved these changes Oct 28, 2026
@mergify

mergify Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

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 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue

2 h 41 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Wed 28 Oct, 15:57 · rule default-squash · triggered by rule automatic merge
  • 🚫 Left the queue 18:38 · 3d8db1f

Reason

The pull request can't be updated

GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/README.md without workflows permission
GitHub only lets Mergify write to .github/workflows/ with the workflows permission. An organization owner can accept Mergify's pending permissions at https://dashboard.mergify.com/orgs/aws/repositories.

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.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

Times in UTC · dashboard · how the merge queue works

@mergify

mergify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@mergify

mergify Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

🚫 Left the queue

2 h 41 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Wed 28 Oct, 15:57 · rule default-squash · triggered by rule automatic merge
  • 🚫 Left the queue 18:38 · 3d8db1f

Reason

The pull request can't be updated

GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/README.md without workflows permission
GitHub only lets Mergify write to .github/workflows/ with the workflows permission. An organization owner can accept Mergify's pending permissions at https://dashboard.mergify.com/orgs/aws/repositories.

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.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot dismissed aemada-aws’s stale review October 30, 2026 15:17

Pull request has been modified.

@maintainer-for-aws

Copy link
Copy Markdown

Automated review

A maintainer will still review this — treat the notes below as a starting point.

📌 Commit 602eba1

This PR enriches the JSDoc on three SNS topic methods — addSubscription, grantPublish, and grantSubscribe — in packages/aws-cdk-lib/aws-sns/lib/topic-base.ts, documenting the IAM actions each grant produces (sns:Publish plus conditional kms:Decrypt/kms:GenerateDataKey*, and sns:Subscribe) and the AWS::SNS::Subscription resource created. The change is comment text only: no signatures, types, exports, logic paths, or synthesized output are altered. The documented actions and the KMS caveat match the actual grant behavior, and no new regression, breaking change, or security exposure is introduced. No issues found on this change.

🔴 0 blocking · 🟡 0 recommended · ⚪ 0 optional


Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews.

This branch was previously deployed

1 inactive deployment
automation — 602eba10 Deployed Oct 30, 2026 by tiwari91 via validate-pr #375686
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 effort/small Small work item – less than a day of effort p2 pr/community-review-timeout pr/needs-maintainer-review This PR needs a review from a Core Team Member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sns: Add details to aws_cdk.aws_sns/Topic.html documentation

4 participants