This topic explains how to configure tags for an Amazon SNS topic using the AWS Management Console, an AWS SDK, or the AWS CLI.
Important
Do not add personally identifiable information (PII) or other confidential or sensitive information in tags. Tags are accessible to other Amazon Web Services, including billing. Tags are not intended to be used for private or sensitive data.
Listing, adding, and
removing tags for an Amazon SNS topic using the AWS Management Console
Sign in to the Amazon SNS console
. -
On the navigation panel, choose Topics.
-
On the Topics page, choose a topic and then choose Edit.
-
Expand the Tags section.
The tags added to the topic are listed.
-
Modify topic tags:
-
To add a tag, choose Add tag and enter a Key and Value (optional).
-
To remove a tag, choose Remove tag next to a key-value pair.
-
-
Choose Save changes.
Adding tags to a topic using an AWS
SDK
To use an AWS SDK, you must configure it with your credentials. For more information, see The shared config and credentials files in the AWS SDKs and Tools Reference Guide.
The following code examples show how to use TagResource
.
- AWS CLI
-
To add a tag to a topic
The following
tag-resource
example adds a metadata tag to the specified Amazon SNS topic.aws sns tag-resource \ --resource-arn
arn:aws:sns:us-west-2:123456789012:MyTopic
\ --tagsKey=Team,Value=Alpha
This command produces no output.
-
For API details, see TagResource
in AWS CLI Command Reference.
-
Managing tags with Amazon SNS API
actions
To manage tags using the Amazon SNS API, use the following API actions:
API actions that support ABAC
The following is a list of API actions that support attribute-based access control (ABAC). For more details about ABAC, see What is ABAC for AWS? in the IAM User Guide.