Inspector / Client / list_tags_for_resource

list_tags_for_resource#

Inspector.Client.list_tags_for_resource(**kwargs)#

Lists all tags associated with an assessment template.

See also: AWS API Documentation

Request Syntax

response = client.list_tags_for_resource(
    resourceArn='string'
)
Parameters:

resourceArn (string) –

[REQUIRED]

The ARN that specifies the assessment template whose tags you want to list.

Return type:

dict

Returns:

Response Syntax

{
    'tags': [
        {
            'key': 'string',
            'value': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • tags (list) –

      A collection of key and value pairs.

      • (dict) –

        A key and value pair. This data type is used as a request parameter in the SetTagsForResource action and a response element in the ListTagsForResource action.

        • key (string) –

          A tag key.

        • value (string) –

          A value assigned to a tag key.

Exceptions

  • Inspector.Client.exceptions.InternalException

  • Inspector.Client.exceptions.InvalidInputException

  • Inspector.Client.exceptions.AccessDeniedException

  • Inspector.Client.exceptions.NoSuchEntityException

Examples

Lists all tags associated with an assessment template.

response = client.list_tags_for_resource(
    resourceArn='arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-gcwFliYu',
)

print(response)

Expected Output:

{
    'tags': [
        {
            'key': 'Name',
            'value': 'Example',
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}