Lambda.Client.
tag_resource
(**kwargs)¶Adds tags to a function.
See also: AWS API Documentation
Request Syntax
response = client.tag_resource(
Resource='string',
Tags={
'string': 'string'
}
)
[REQUIRED]
The function's Amazon Resource Name (ARN).
[REQUIRED]
A list of tags to apply to the function.
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': {
'...': '...',
},
}