Lambda / Client / list_tags

list_tags#

Lambda.Client.list_tags(**kwargs)#

Returns a function, event source mapping, or code signing configuration’s tags. You can also view function tags with GetFunction.

See also: AWS API Documentation

Request Syntax

response = client.list_tags(
    Resource='string'
)
Parameters:

Resource (string) –

[REQUIRED]

The resource’s Amazon Resource Name (ARN). Note: Lambda does not support adding tags to function aliases or versions.

Return type:

dict

Returns:

Response Syntax

{
    'Tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) –

    • Tags (dict) –

      The function’s tags.

      • (string) –

        • (string) –

Exceptions

  • Lambda.Client.exceptions.ServiceException

  • Lambda.Client.exceptions.ResourceNotFoundException

  • Lambda.Client.exceptions.InvalidParameterValueException

  • Lambda.Client.exceptions.TooManyRequestsException

Examples

The following example displays the tags attached to the my-function Lambda function.

response = client.list_tags(
    Resource='arn:aws:lambda:us-west-2:123456789012:function:my-function',
)

print(response)

Expected Output:

{
    'Tags': {
        'Category': 'Web Tools',
        'Department': 'Sales',
    },
    'ResponseMetadata': {
        '...': '...',
    },
}