All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel3
typeflat

...

Overview

The following operations allow you to work with permissions. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with permissions, see Sample configuration.

OperationDescription

1Working with Permission in Amazon SNSaddPermission

Adds a statement to a topic's access control policy.

1Working with Permission in Amazon SNSremovePermissionRemoves a statement from a topic's access control policy.

Operation details

This section provides details on each operation.

Anchor
addPermission
addPermission
Add Permission

This operation adds a statement to a topic's access control policy, granting access for the specified AWS accounts to the specified actions.

Code Block
languagexml
titleaddPermission
<amazonsns.addPermission>
    <topicArn>{$ctx:topicArn}</topicArn>
    <label>{$ctx:label}</label>
    <actionNameMember>{$ctx:actionNameMember}</actionNameMember>
    <accountIdMember>{$ctx:accountIdMember}</accountIdMember>
</amazonsns.addPermission>
Properties
  • topicArn: Required - The ARN of the topic whose access control policy you wish to modify.
  • actionNameMember: Required - The action you want to allow for the specified principal(s).
  • accountIdMember: Required - The AWS account IDs of the users (principals) who will be given access to the specified actions.
  • label: Required - A unique identifier for the new policy statement.
Anchor
request
request
 
Sample requestSample request

Following is a sample REST/XML request that can be handled by the addPermission operation

Code Block
languagexml
titleSample Request for addPermission
<addPermission>
   	<region>us-west-2</region>
   	<accessKeyId>AKIAJXHDKJWR2ZVPEdBTQ</accessKeyId>
   	<secretAccessKey>N9VTSD2P3MaL7Li1P3hgJu1GTtOO7Kd7NfPlyYG8f/6</secretAccessKey>
   	<topicArn>arn:aws:sns:us-west-2:899940420354:Test_Topic_300</topicArn>
	<label>NewPermission</label>
	<actionNameMember>Publish</actionNameMember>
	<accountIdMember>XXX4922XX281XX98692XXXX</accountIdMember>
	<version></version>
</addPermission>

Anchor
removePermission
removePermission
Remove Permission

This operation removes a statement from a topic's access control policy.

Code Block
languagexml
titleremovePermission
<amazonsns.removePermission>
    <topicArn>{$ctx:topicArn}</topicArn>
    <label>{$ctx:label}</label>
</amazonsns.removePermission>
Properties
  • topicArn: Required - The ARN of the topic whose access control policy you wish to modify.
  • label: Required - The unique label of the statement you want to remove.
Sample request

Following is a sample REST/XML request that can be handled by the removePermission operation

Code Block
languagexml
titleSample Request for removePermission
<removePermission>
   	<region>us-west-2</region>
   	<accessKeyId>AKIAJXHDKJWR2ZVPEdBTQ</accessKeyId>
   	<secretAccessKey>N9VTSD2P3MaL7Li1P3hgJu1GTtOO7Kd7NfPlyYG8f/6</secretAccessKey>
   	<topicArn>arn:aws:sns:us-west-2:899940420354:Test_Topic_300</topicArn>
	<label>NewPermission</label>
	<version></version>
</removePermission>

Anchor
sample
sample

Sample configuration

Following is a sample proxy service that illustrates how to connect to Amazon SNS with the init operation and use the addPermission operation. The sample request for this proxy can be found in addPermission sample request. You can use this sample as a template for using other operations in this category.

...