Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class AddPermissionCommandProtected

Adds a statement to a topic's access control policy, granting access for the specified Amazon Web Services accounts to the specified actions.

To remove the ability to change topic permissions, you must deny permissions to the AddPermission, RemovePermission, and SetTopicAttributes actions in your IAM policy.

Example

Use a bare-bones client and the command you need to make an API call.

import { SNSClient, AddPermissionCommand } from "@aws-sdk/client-sns"; // ES Modules import
// const { SNSClient, AddPermissionCommand } = require("@aws-sdk/client-sns"); // CommonJS import
const client = new SNSClient(config);
const input = { // AddPermissionInput
TopicArn: "STRING_VALUE", // required
Label: "STRING_VALUE", // required
AWSAccountId: [ // DelegatesList // required
"STRING_VALUE",
],
ActionName: [ // ActionsList // required
"STRING_VALUE",
],
};
const command = new AddPermissionCommand(input);
const response = await client.send(command);
// {};

Param

AddPermissionCommandInput

Returns

AddPermissionCommandOutput

See

Throws

AuthorizationErrorException (client fault)

Indicates that the user has been denied access to the requested resource.

Throws

InternalErrorException (server fault)

Indicates an internal service error.

Throws

InvalidParameterException (client fault)

Indicates that a request parameter does not comply with the associated constraints.

Throws

NotFoundException (client fault)

Indicates that the requested resource does not exist.

Throws

SNSServiceException

Base exception class for all service exceptions from SNS service.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods