- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
SetTopicAttributesCommand
Allows a topic owner to set an attribute of the topic to a new value.
To remove the ability to change topic permissions, you must deny permissions to the AddPermission
, RemovePermission
, and SetTopicAttributes
actions in your IAM policy.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { SNSClient, SetTopicAttributesCommand } from "@aws-sdk/client-sns"; // ES Modules import
// const { SNSClient, SetTopicAttributesCommand } = require("@aws-sdk/client-sns"); // CommonJS import
const client = new SNSClient(config);
const input = { // SetTopicAttributesInput
TopicArn: "STRING_VALUE", // required
AttributeName: "STRING_VALUE", // required
AttributeValue: "STRING_VALUE",
};
const command = new SetTopicAttributesCommand(input);
const response = await client.send(command);
// {};
SetTopicAttributesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
AttributeName Required | string | undefined | A map of attributes with their corresponding values. The following lists the names, descriptions, and values of the special request parameters that the
The The following attribute applies only to server-side-encryption :
The following attribute applies only to FIFO topics :
|
TopicArn Required | string | undefined | The ARN of the topic to modify. |
AttributeValue | string | undefined | The new value for the attribute. |
SetTopicAttributesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AuthorizationErrorException | client | Indicates that the user has been denied access to the requested resource. |
InternalErrorException | server | Indicates an internal service error. |
InvalidParameterException | client | Indicates that a request parameter does not comply with the associated constraints. |
InvalidSecurityException | client | The credential signature isn't valid. You must use an HTTPS endpoint and sign your request using Signature Version 4. |
NotFoundException | client | Indicates that the requested resource does not exist. |
SNSServiceException | Base exception class for all service exceptions from SNS service. |