IAM policy example: publish to one SNS topic, with a least privilege rewrite
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
Allows a service role to publish messages to one SNS topic, alerts-topic. The original allows sns:* on every topic, which includes subscribing outside addresses. The rewrite names the topic ARN and one action. Resource names and account 111122223333 are placeholders used in AWS documentation.
Open the workbench ยท All examples
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublishAny",
"Effect": "Allow",
"Action": "sns:*",
"Resource": "*"
}
]
}
What it allows
- Allows every SNS action on all topics and subscriptions.
What it allows
Allow 41 actions (sns:*) on every resource.
Action or pattern Actions Access levels sns:*41 List 7, Read 10, Write 19, Permissions management 3, Tagging 2
Checks
- High Allows 22 write or permissions-management actions (3 permissions management) on every resource ("Resource": "*"). AWS documentation for this check
The action sns:* covers 41 actions, including subscribing an outside endpoint to a topic and changing its policy.
Least privilege rewrite
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublishOne",
"Effect": "Allow",
"Action": "sns:Publish",
"Resource": "arn:aws:sns:us-east-1:111122223333:alerts-topic"
}
]
}
The rewrite grants Publish on one topic ARN. Subscribing, deleting topics and changing topic policy are removed.
What it allows
Allow 1 action (sns:Publish) on arn:aws:sns:us-east-1:111122223333:alerts-topic.
Action or pattern Actions Access levels sns:Publish1 Write 1
Checks
No flags from the six checks.
Related pages
Sources
- Amazon SNS Developer Guide: identity-based policies, read 16 Nov 2026
- Amazon SNS Developer Guide: access policy use cases, read 16 Nov 2026
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026
Last reviewed 16 Nov 2026.