Actions, Resources, and Condition Keys for Amazon SNS - AWS Identity and Access Management
Description: Lists all of the available service-specific resources, actions, and condition keys that can be used in IAM policies to control access to Amazon SNS.
Keywords: IAM,AWS Identity and Access Management,IAM user,user,IAM group,group,IAM role,role,permission policy,trust policy,policy,access key,password

AWS Identity and Access Management
User Guide

# Actions, Resources, and Condition Keys for Amazon SNS

Amazon SNS (service prefix: `sns`) provides the following service-specific resources, actions, and condition context keys for use in IAM permission policies.

References:

- Learn how to configure this service.

- View a list of the API operations available for this service.

- Learn how to secure this service and its resources by using IAM permission policies.

Topics

- Actions Defined by Amazon SNS
- Resources Defined by Amazon SNS
- Condition Keys for Amazon SNS

## Actions Defined by Amazon SNS

You can specify the following actions in the `Action` element of an IAM policy statement. Use policies to grant permissions to perform an operation in AWS. When you use an action in a policy, you usually allow or deny access to the API operation or CLI command with the same name. However, in some cases, a single action controls access to more than one operation. Alternatively, some operations require several different actions.

The Resource column indicates whether each action supports resource-level permissions. If there is no value for this column, you must specify all resources ("*") in the `Resource` element of your policy statement. If the column includes a resource type, then you can specify an ARN of that type in a statement with that action. Required resources are indicated in the table with an asterisk (*). If you specify a resource-level permission ARN in a statement using this action, then it must be of this type. Some actions support multiple resource types. If the resource type is optional (not indicated as required), then you can choose to use one but not the other.

For details about the columns in the following table, see The Actions Table.

Actions | Description | Access Level | Resource Types (*required) | Condition Keys | Dependent Actions
--- | --- | --- | --- | --- | ---
AddPermission | Adds a statement to a topic's access control policy, granting access for the specified AWS accounts to the specified actions. | Permissions management | topic* |  |
CheckIfPhoneNumberIsOptedOut | Accepts a phone number and indicates whether the phone holder has opted out of receiving SMS messages from your account. | Read |  |  |
ConfirmSubscription | Verifies an endpoint owner's intent to receive messages by validating the token sent to the endpoint by an earlier Subscribe action. | Write | topic* |  |
CreatePlatformApplication | Creates a platform application object for one of the supported push notification services, such as APNS and GCM, to which devices and mobile apps may register. | Write |  |  |
CreatePlatformEndpoint | Creates an endpoint for a device and mobile app on one of the supported push notification services, such as GCM and APNS. | Write |  |  |
CreateTopic | Creates a topic to which notifications can be published. | Write | topic* |  |
DeleteEndpoint | Deletes the endpoint for a device and mobile app from Amazon SNS. | Write |  |  |
DeletePlatformApplication | Deletes a platform application object for one of the supported push notification services, such as APNS and GCM. | Write |  |  |
DeleteTopic | Deletes a topic and all its subscriptions. | Write | topic* |  |
GetEndpointAttributes | Retrieves the endpoint attributes for a device on one of the supported push notification services, such as GCM and APNS. | Read |  |  |
GetPlatformApplicationAttributes | Retrieves the attributes of the platform application object for the supported push notification services, such as APNS and GCM. | Read |  |  |
GetSMSAttributes | Returns the settings for sending SMS messages from your account. | Read |  |  |
GetSubscriptionAttributes | Returns all of the properties of a subscription. | Read |  |  |
GetTopicAttributes | Returns all of the properties of a topic. Topic properties returned might differ based on the authorization of the user. | Read | topic* |  |
ListEndpointsByPlatformApplication | Lists the endpoints and endpoint attributes for devices in a supported push notification service, such as GCM and APNS. | List |  |  |
ListPhoneNumbersOptedOut | Returns a list of phone numbers that are opted out, meaning you cannot send SMS messages to them. | Read |  |  |
ListPlatformApplications | Lists the platform application objects for the supported push notification services, such as APNS and GCM. | List |  |  |
ListSubscriptions | Returns a list of the requester's subscriptions. | List |  |  |
ListSubscriptionsByTopic | Returns a list of the subscriptions to a specific topic. | List | topic* |  |
ListTagsForResource | List all tags added to the specified Amazon SNS topic. | Read | topic |  |
ListTopics | Returns a list of the requester's topics. Each call returns a limited list of topics, up to 100. | List |  |  |
OptInPhoneNumber | Opts in a phone number that is currently opted out, which enables you to resume sending SMS messages to the number. | Write |  |  |
Publish | Sends a message to all of a topic's subscribed endpoints. | Write | topic* |  |
RemovePermission | Removes a statement from a topic's access control policy. | Permissions management | topic* |  |
SetEndpointAttributes | Sets the attributes for an endpoint for a device on one of the supported push notification services, such as GCM and APNS. | Write |  |  |
SetPlatformApplicationAttributes | Sets the attributes of the platform application object for the supported push notification services, such as APNS and GCM. | Write |  |  |
SetSubscriptionAttributes | Allows a subscription owner to set an attribute of the topic to a new value. | Write |  |  |
SetTopicAttributes | Allows a topic owner to set an attribute of the topic to a new value. | Write | topic* |  |
Subscribe | Prepares to subscribe an endpoint by sending the endpoint a confirmation message. | Write | topic* |  |
| sns:Endpoint sns:Protocol |
TagResource | Add tags to the specified Amazon SNS topic. | Tagging | topic |  |
| aws:RequestTag/${TagKey} aws:TagKeys |
Unsubscribe | Deletes a subscription. If the subscription requires authentication for deletion, only the owner of the subscription or the topic's owner can unsubscribe, and an AWS signature is required. | Write |  |  |
UntagResource | Remove tags from the specified Amazon SNS topic. | Tagging | topic |  |
| aws:RequestTag/${TagKey} aws:TagKeys |

## Resources Defined by Amazon SNS

The following resource types are defined by this service and can be used in the `Resource` element of IAM permission policy statements. Each action in the Actions table identifies the resource types that can be specified with that action. A resource type can also define which condition keys you can include in a policy. These keys are displayed in the last column of the table. For details about the columns in the following table, see The Resource Types Table.

Resource Types | ARN | Condition Keys
--- | --- | ---
topic | `arn:${Partition}:sns:${Region}:${Account}:${TopicName}` |

## Condition Keys for Amazon SNS

Amazon SNS defines the following condition keys that can be used in the `Condition` element of an IAM policy. You can use these keys to further refine the conditions under which the policy statement applies. For details about the columns in the following table, see The Condition Keys Table.

To view the global condition keys that are available to all services, see Available Global Condition Keys in the IAM Policy Reference.

Condition Keys | Description | Type
--- | --- | ---
aws:RequestTag/${TagKey} | Tags from request | String
aws:TagKeys | Tag keys from request | String
sns:Endpoint | The URL, email address, or ARN from a Subscribe request or a previously confirmed subscription. | String
sns:Protocol | The protocol value from a Subscribe request or a previously confirmed subscription. | String

On this page:

- Actions Defined by Amazon SNS
- Resources Defined by Amazon SNS
- Condition Keys for Amazon SNS

We use cookies to provide and improve our services. By using our site, you consent to cookies. Learn more