:doc:`IAMRolesAnywhere <../../rolesanywhere>` / Client / tag_resource

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



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

  

  Attaches tags to a resource.

   

  **Required permissions:** ``rolesanywhere:TagResource``.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/rolesanywhere-2018-05-10/TagResource>`_  


  **Request Syntax**
  ::

    response = client.tag_resource(
        resourceArn='string',
        tags=[
            {
                'key': 'string',
                'value': 'string'
            },
        ]
    )
    
  :type resourceArn: string
  :param resourceArn: **[REQUIRED]** 

    The ARN of the resource.

    

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

    The tags to attach to the resource.

    

  
    - *(dict) --* 

      A label that consists of a key and value you define.

      

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

        The tag key.

        

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

        The tag value.

        

      
    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`IAMRolesAnywhere.Client.exceptions.ValidationException`

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

  
  *   :py:class:`IAMRolesAnywhere.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`IAMRolesAnywhere.Client.exceptions.TooManyTagsException`

  