Displays the tags associated with a CloudWatch resource. Currently, alarms and Contributor Insights rules support tagging.
See also: AWS API Documentation
Request Syntax
response = client.list_tags_for_resource(
ResourceARN='string'
)
[REQUIRED]
The ARN of the CloudWatch resource that you want to view tags for.
The ARN format of an alarm is arn:aws:cloudwatch:Region:account-id:alarm:alarm-name
The ARN format of a Contributor Insights rule is arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name
For more information about ARN format, see Resource Types Defined by Amazon CloudWatch in the Amazon Web Services General Reference .
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
The list of tag keys and values associated with the resource you specified.
A key-value pair associated with a CloudWatch resource.
A string that you can use to assign a value. The combination of tag keys and values can help you organize and categorize your resources.
The value for the specified tag key.
Exceptions
CloudWatch.Client.exceptions.InvalidParameterValueException
CloudWatch.Client.exceptions.ResourceNotFoundException
CloudWatch.Client.exceptions.InternalServiceFault