Managing a topic
Written by
Updated at September 12, 2025
Updating a topic
Management console
AWS CLI
AWS SDK for Python
- In the management console
, select the folder containing the topic. - In the list of services, select Cloud Notification Service.
- Select Topics on the left.
- Select the topic.
- At the top right, click Edit.
- Edit the topic name. The name must be unique within Cloud Notification Service.
- Under Logging, enable or disable Write logs.
- Update the existing log group or create a new one.
- Click Save changes.
-
If you do not have the AWS CLI yet, install and configure it.
-
Run this command:
aws sns set-topic-attributes \ --topic-arn <topic_ARN> <attributes> -
View the new topic settings:
aws sns get-topic-attributes \ --topic-arn <topic_ARN>
For more information about the set-topic-attributes
-
If you do not have the AWS SDK for Python (boto3) yet, install and configure it.
-
To update a topic, use the code below:
try: response = client.set_topic_attributes( TopicArn = "<topic_ARN>", AttributeName='<attribute_name>', AttributeValue='<attribute_value>' ) print("Response metadata:", response['ResponseMetadata'])
Deleting a topic
Management console
AWS CLI
AWS SDK for Python
- In the management console
, select the folder containing the topic. - In the list of services, select Cloud Notification Service.
- Select Topics on the left.
- Click
next to the topic of interest and select Delete. - Confirm the deletion.
Run this command:
aws sns delete-topic --topic-arn <topic_ARN>
For more information about the aws sns delete-topic command, see the AWS documentation
Use the following code:
@staticmethod
def delete_topic(topic):
try:
topic.delete()
logger.info("Deleted topic %s.", topic.arn)
except ClientError:
logger.exception("Couldn't delete topic %s.", topic.arn)
raise
Deleting a topic will also delete all its subscriptions. The endpoints associated with the subscriptions will remain. Topic deletion may take a while. You cannot create a new topic with the same name while the topic is being deleted.