list_tags_for_resource

CloudWatch.Client.list_tags_for_resource(**kwargs)

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'
)
Parameters
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 .

Return type
dict
Returns
Response Syntax
{
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) --
    • Tags (list) --

      The list of tag keys and values associated with the resource you specified.

      • (dict) --

        A key-value pair associated with a CloudWatch resource.

        • Key (string) --

          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.

        • Value (string) --

          The value for the specified tag key.

Exceptions

  • CloudWatch.Client.exceptions.InvalidParameterValueException
  • CloudWatch.Client.exceptions.ResourceNotFoundException
  • CloudWatch.Client.exceptions.InternalServiceFault