Skip to content

How do I edit my Amazon SNS topic's access policy?

2 minute read
0

I want to allow other AWS Identity and Access Management (IAM) entities to access my Amazon Simple Notification Service (Amazon SNS) topic.

Short description

You can use either the Amazon SNS console or the AWS Command Line Interface (AWS CLI) to edit your SNS topic's access policy.

Resolution

Use the Amazon SNS console to edit your Amazon SNS topic's access policy

Complete the following steps:

  1. Open the Amazon SNS console.
  2. In the navigation pane, choose Topics.
  3. Choose your Amazon SNS topic's name, and then choose Edit.
  4. Expand the Access policy - optional section.
  5. Edit the access policy to grant the required permissions for your use case.
    Note: For more information on access policies, see Example cases for Amazon SNS access control.
  6. Choose Save changes.

Use the AWS CLI to edit your Amazon SNS topic's access policy

Note: If you receive errors when you run AWS CLI commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.

To modify, add, or remove permissions, run the following set-topic-attributes command:

aws sns set-topic-attributes --topic-arn your-topic-ARN --attribute-name your-policy-name --attribute-value file://yourpolicy.json

Note: Replace your-topic-ARN with your topic's Amazon Resource Name (ARN). Replace your-policy-name with the name of your access policy and yourpolicy.json with the path to your policy document.

Related information

Actions, resources, and condition keys for Amazon SNS