Lambda / Client / tag_resource

tag_resource#

Lambda.Client.tag_resource(**kwargs)#

Adds tags to a function, event source mapping, or code signing configuration.

See also: AWS API Documentation

Request Syntax

response = client.tag_resource(
    Resource='string',
    Tags={
        'string': 'string'
    }
)
Parameters:
  • Resource (string) –

    [REQUIRED]

    The resource’s Amazon Resource Name (ARN).

  • Tags (dict) –

    [REQUIRED]

    A list of tags to apply to the resource.

    • (string) –

      • (string) –

Returns:

None

Exceptions

  • Lambda.Client.exceptions.ServiceException

  • Lambda.Client.exceptions.ResourceNotFoundException

  • Lambda.Client.exceptions.InvalidParameterValueException

  • Lambda.Client.exceptions.TooManyRequestsException

  • Lambda.Client.exceptions.ResourceConflictException

Examples

The following example adds a tag with the key name DEPARTMENT and a value of ‘Department A’ to the specified Lambda function.

response = client.tag_resource(
    Resource='arn:aws:lambda:us-west-2:123456789012:function:my-function',
    Tags={
        'DEPARTMENT': 'Department A',
    },
)

print(response)

Expected Output:

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