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
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 types 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 | |||
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 | |||
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 |
iam:PassRole |
||
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 |
iam:PassRole |
||
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 | |||
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 | |||
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 | |||
ListTagsForResource | List all tags added to the specified Amazon SNS topic. | Read | |||
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 | |||
RemovePermission | Removes a statement from a topic's access control policy. | Permissions management | |||
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 |
iam:PassRole |
||
SetSMSAttributes | Set the default settings for sending SMS messages and receiving daily SMS usage reports. | 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 |
iam:PassRole |
||
Subscribe | Prepares to subscribe an endpoint by sending the endpoint a confirmation message. | Write | |||
TagResource | Add tags to the specified Amazon SNS topic. | Tagging | |||
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 | |||
Resource types 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.
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 |