:doc:`DataSync <../../datasync>` / Client / tag_resource

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



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

  

  Applies a *tag* to an Amazon Web Services resource. Tags are key-value pairs that can help you manage, filter, and search for your resources.

   

  These include DataSync resources, such as locations, tasks, and task executions.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/TagResource>`_  


  **Request Syntax**
  ::

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

    Specifies the Amazon Resource Name (ARN) of the resource to apply the tag to.

    

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

    Specifies the tags that you want to apply to the resource.

    

  
    - *(dict) --* 

      A key-value pair representing a single tag that's been applied to an Amazon Web Services resource.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        The key for an Amazon Web Services resource tag.

        

      
      - **Value** *(string) --* 

        The value for an Amazon Web Services resource tag.

        

      
    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`DataSync.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`DataSync.Client.exceptions.InternalException`

  