:doc:`AppMesh <../../appmesh>` / Client / tag_resource

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



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

  

  Associates the specified tags to a resource with the specified ``resourceArn``. If existing tags on a resource aren't specified in the request parameters, they aren't changed. When a resource is deleted, the tags associated with that resource are also deleted.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/appmesh-2019-01-25/TagResource>`_  


  **Request Syntax**
  ::

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

    The Amazon Resource Name (ARN) of the resource to add tags to.

    

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

    The tags to add to the resource. A tag is an array of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

    

  
    - *(dict) --* 

      Optional metadata that you apply to a resource to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

      

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

        One part of a key-value pair that make up a tag. A ``key`` is a general label that acts like a category for more specific tag values.

        

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

        The optional part of a key-value pair that make up a tag. A ``value`` acts as a descriptor within a tag category (key).

        

      
    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`AppMesh.Client.exceptions.NotFoundException`

  
  *   :py:class:`AppMesh.Client.exceptions.BadRequestException`

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

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

  
  *   :py:class:`AppMesh.Client.exceptions.ForbiddenException`

  
  *   :py:class:`AppMesh.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`AppMesh.Client.exceptions.InternalServerErrorException`

  