Inspector / Client / set_tags_for_resource

set_tags_for_resource#

Inspector.Client.set_tags_for_resource(**kwargs)#

Sets tags (key and value pairs) to the assessment template that is specified by the ARN of the assessment template.

See also: AWS API Documentation

Request Syntax

response = client.set_tags_for_resource(
    resourceArn='string',
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ]
)
Parameters:
  • resourceArn (string) –

    [REQUIRED]

    The ARN of the assessment template that you want to set tags to.

  • tags (list) –

    A collection of key and value pairs that you want to set to the assessment template.

    • (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) – [REQUIRED]

        A tag key.

      • value (string) –

        A value assigned to a tag key.

Returns:

None

Exceptions

  • Inspector.Client.exceptions.InternalException

  • Inspector.Client.exceptions.InvalidInputException

  • Inspector.Client.exceptions.AccessDeniedException

  • Inspector.Client.exceptions.NoSuchEntityException

  • Inspector.Client.exceptions.ServiceTemporarilyUnavailableException

Examples

Sets tags (key and value pairs) to the assessment template that is specified by the ARN of the assessment template.

response = client.set_tags_for_resource(
    resourceArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0',
    tags=[
        {
            'key': 'Example',
            'value': 'example',
        },
    ],
)

print(response)

Expected Output:

{
    'ResponseMetadata': {
        '...': '...',
    },
}