

# Amazon SNS API permissions: Actions and resources reference
API permissions reference

The following list grants information specific to the Amazon SNS implementation of access control:
+ Each policy must cover only a single topic (when writing a policy, don't include statements that cover different topics)
+ Each policy must have a unique policy `Id`
+ Each statement in a policy must have a unique statement `sid`

## Policy quotas


The following table lists the maximum quotas for a policy statement.


| Name | Maximum quota | 
| --- | --- | 
|  Bytes  |  30 kb  | 
|  Statements  |  100  | 
|  Principals  |  1 to 200 (0 is invalid.)  | 
|  Resource  |  1 (0 is invalid. The value must match the ARN of the policy's topic.)  | 

## Valid Amazon SNS policy actions


Amazon SNS supports the actions shown in the following table.


| Action | Description | 
| --- | --- | 
| sns:AddPermission | Grants permission to add permissions to the topic policy. | 
| sns:DeleteTopic | Grants permission to delete a topic. | 
| sns:GetDataProtectionPolicy | Grants permission to retrieve a topic's data protection policy.  | 
| sns:GetTopicAttributes  | Grants permission to receive all of the topic attributes. | 
| sns:ListSubscriptionsByTopic | Grants permission to retrieve all the subscriptions to a specific topic. | 
| sns:ListTagsForResource | Grants permission to list all tags added to a specific topic. | 
| sns:Publish  | Grants permission to both publish and publish batch to a topic or endpoint. For more information, see [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) and [PublishBatch](https://docs.aws.amazon.com/sns/latest/api/API_BatchPublish.html) in the Amazon Simple Notification Service API Reference. | 
| sns:PutDataProtectionPolicy | Grants permission to set a topic's data protection policy. | 
| sns:RemovePermission  | Grants permission to remove any permissions in the topic policy. | 
| sns:SetTopicAttributes  | Grants permission to set a topic's attributes. | 
| sns:Subscribe  | Grants permission to subscribe to a topic. | 

## Service-specific keys


Amazon SNS uses the following service-specific keys. You can use these in policies that restrict access to `Subscribe` requests.
+ **sns:endpoint—**The URL, email address, or ARN from a `Subscribe` request or a previously confirmed subscription. Use with string conditions (see [Example policies for Amazon SNS](sns-using-identity-based-policies.md#sns-example-policies)) to restrict access to specific endpoints (for example, \$1@example.com).
+ **sns:protocol—**The `protocol` value from a `Subscribe` request or a previously confirmed subscription. Use with string conditions (see [Example policies for Amazon SNS](sns-using-identity-based-policies.md#sns-example-policies)) to restrict publication to specific delivery protocols (for example, https).

**Important**  
When you use a policy to control access by sns:Endpoint, be aware that DNS issues might affect the endpoint's name resolution in the future.

# Troubleshooting Amazon Simple Notification Service identity and access
Troubleshooting

Use the following information to help you diagnose and fix common issues that you might encounter when working with Amazon SNS and IAM.

## I am not authorized to perform an action in Amazon SNS


If you receive an error that you're not authorized to perform an action, your policies must be updated to allow you to perform the action.

The following example error occurs when the `mateojackson` user tries to use the console to view details about a fictional `my-example-widget` resource but does not have the fictional `sns:GetWidget` permissions.

```
User: arn:aws:iam::123456789012:user/mateojackson is not authorized to perform: sns:GetWidget on resource: my-example-widget
```

In this case, Mateo's policy must be updated to allow him to access the `my-example-widget` resource using the `sns:GetWidget` action.

If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials.

## I am not authorized to perform iam:PassRole


If you receive an error that you're not authorized to perform the `iam:PassRole` action, your policies must be updated to allow you to pass a role to Amazon SNS.

Some AWS services allow you to pass an existing role to that service instead of creating a new service role or service-linked role. To do this, you must have permissions to pass the role to the service.

The following example error occurs when an IAM user named `marymajor` tries to use the console to perform an action in Amazon SNS. However, the action requires the service to have permissions that are granted by a service role. Mary does not have permissions to pass the role to the service.

```
User: arn:aws:iam::123456789012:user/marymajor is not authorized to perform: iam:PassRole
```

In this case, Mary's policies must be updated to allow her to perform the `iam:PassRole` action.

If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials.

## I want to allow people outside of my AWS account to access my Amazon SNS resources


You can create a role that users in other accounts or people outside of your organization can use to access your resources. You can specify who is trusted to assume the role. For services that support resource-based policies or access control lists (ACLs), you can use those policies to grant people access to your resources.

To learn more, consult the following:
+ To learn whether Amazon SNS supports these features, see [How Amazon SNS works with IAM](security_iam_service-with-iam.md).
+ To learn how to provide access to your resources across AWS accounts that you own, see [Providing access to an IAM user in another AWS account that you own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*.
+ To learn how to provide access to your resources to third-party AWS accounts, see [Providing access to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*.
+ To learn how to provide access through identity federation, see [Providing access to externally authenticated users (identity federation)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*.
+ To learn the difference between using roles and resource-based policies for cross-account access, see [Cross account resource access in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html) in the *IAM User Guide*.