docs(sns): expand grant* JSDoc with granted actions - #37991
Conversation
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
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
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). |
Merge Queue Status
This pull request spent 8 hours 49 minutes 47 seconds in the queue, with no time running CI. Waiting for any of
All conditions
ReasonThe 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:
These checks were still running:
HintA 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 Tick the box to put this pull request back in the merge queue (same as
|
Issue # (if applicable)
Closes #35736.
Reason for this change
The SNS
TopicAPI reference is light on detail compared to SQS. In particular,grantPublishandgrantSubscribedo 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
ITopicandTopicBaseinpackages/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@seelink to the SNS server-side encryption docs.grantSubscribe: lists the granted IAM action (sns:Subscribe) and clarifies that this only grants permission to call theSubscribeAPI, 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/grantSendMessagesinpackages/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
packages/aws-cdk-lib/aws-sns/test/sns.test.ts:give publishing permissions to CfnTopicassertssns:Publish.give service principal permissions to publish to CfnTopic with encryption keyassertskms:Decryptandkms:GenerateDataKey*on the master key.give subscribing permissionsassertssns:Subscribe.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license