:doc:`Lambda <../../lambda>` / Client / tag_resource

************
tag_resource
************



.. py:method:: Lambda.Client.tag_resource(**kwargs)

  

  Adds `tags <https://docs.aws.amazon.com/lambda/latest/dg/tagging.html>`__ to a function, event source mapping, or code signing configuration.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/TagResource>`_  


  **Request Syntax**
  ::

    response = client.tag_resource(
        Resource='string',
        Tags={
            'string': 'string'
        }
    )
    
  :type Resource: string
  :param Resource: **[REQUIRED]** 

    The resource's Amazon Resource Name (ARN).

    

  
  :type Tags: dict
  :param Tags: **[REQUIRED]** 

    A list of tags to apply to the resource.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  
  :returns: None
  **Exceptions**
  
  *   :py:class:`Lambda.Client.exceptions.InvalidParameterValueException`

  
  *   :py:class:`Lambda.Client.exceptions.ResourceConflictException`

  
  *   :py:class:`Lambda.Client.exceptions.ServiceException`

  
  *   :py:class:`Lambda.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`Lambda.Client.exceptions.ResourceNotFoundException`

  

  **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': {
            '...': '...',
        },
    }

  