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.
-
For a complete list of AWS SDK developer guides and code examples, see Using Amazon SNS with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.