Skip to content

docs(sns): expand grant* JSDoc with granted actions - #37991

Open
MukundaKatta wants to merge 6 commits into
aws:mainfrom
MukundaKatta:docs/sns-topic-grant-permissions-jsdoc
Open

docs(sns): expand grant* JSDoc with granted actions#37991
MukundaKatta wants to merge 6 commits into
aws:mainfrom
MukundaKatta:docs/sns-topic-grant-permissions-jsdoc

Conversation

@MukundaKatta

Copy link
Copy Markdown

Issue # (if applicable)

Closes #35736.

Reason for this change

The SNS Topic API reference is light on detail compared to SQS. In particular, grantPublish and grantSubscribe do not list the IAM and KMS actions they grant, so users have to read the source to confirm whether SSE-encrypted topics are handled correctly.

Description of changes

JSDoc-only update on ITopic and TopicBase in packages/aws-cdk-lib/aws-sns/lib/topic-base.ts:

  • grantPublish: lists the granted IAM action (sns:Publish) and the KMS actions (kms:Decrypt, kms:GenerateDataKey*) added when the topic is encrypted with a customer-managed KMS key. Adds a @see link to the SNS server-side encryption docs.
  • grantSubscribe: lists the granted IAM action (sns:Subscribe) and clarifies that this only grants permission to call the Subscribe API, not to receive messages on a particular delivery protocol. Notes that KMS permissions are not required for subscribing.

Follows the same JSDoc style already used by grantConsumeMessages / grantSendMessages in packages/aws-cdk-lib/aws-sqs/lib/queue-base.ts.

Describe any new or updated permissions being added

None. This PR is documentation only and does not change any granted permissions or generated CloudFormation output.

Description of how you validated changes

  • Confirmed the listed actions against existing unit tests in packages/aws-cdk-lib/aws-sns/test/sns.test.ts:
    • give publishing permissions to CfnTopic asserts sns:Publish.
    • give service principal permissions to publish to CfnTopic with encryption key asserts kms:Decrypt and kms:GenerateDataKey* on the master key.
    • give subscribing permissions asserts sns:Subscribe.
  • No runtime/behavior changes, so no new tests added.

Checklist


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

List the IAM and KMS permissions granted by grantPublish and
grantSubscribe so users can see what the helpers do without reading
the source.

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 May 24, 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)

@MukundaKatta MukundaKatta changed the title docs(aws-sns): expand grant* JSDoc with granted actions docs(sns): expand grant* JSDoc with granted actions May 27, 2026
@aws-cdk-automation
aws-cdk-automation dismissed their stale review May 27, 2026 05:45

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@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
gjurova
gjurova previously approved these changes Jul 31, 2026
@mergify

mergify Bot commented Jul 31, 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 Jul 31, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-07-31 09:48 UTC · Rule: default-squash · triggered by rule automatic merge
  • Checks timed out · in-place
  • 🚫 Left the queue2026-07-31 18:38 UTC · at 40a458865dee763c1a6656c8c1f68149913a20bf

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

Waiting for any of
  • check-neutral = build
  • check-skipped = build
  • check-success = build
All conditions

Reason

The merge conditions cannot be satisfied: the checks did not pass within the checks timeout of 8 hours 48 minutes 59 seconds

These checks never reported on this pull request:

  • Deploy integration test snapshots (requires pr/needs-integration-tests-deployment label)
  • Configuration changed

These checks were still running:

  • build

Hint

A check that never reports can never satisfy its merge condition. Check that the check names in your merge conditions match what your CI publishes.

If you want to requeue this pull request, you can post 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

@mergify
mergify Bot dismissed gjurova’s stale review August 3, 2026 14:55

Pull request has been modified.

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/needs-community-review This PR needs a review from a Trusted Community Member or 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

5 participants