:doc:`RAM <../../ram>` / Client / tag_resource

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



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

  

  Adds the specified tag keys and values to a resource share or managed permission. If you choose a resource share, the tags are attached to only the resource share, not to the resources that are in the resource share.

   

  The tags on a managed permission are the same for all versions of the managed permission.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/TagResource>`_  


  **Request Syntax**
  ::

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

    Specifies the `Amazon Resource Name (ARN) <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__ of the resource share that you want to add tags to. You must specify *either* ``resourceShareArn``, or ``resourceArn``, but not both.

    

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

    A list of one or more tag key and value pairs. The tag key must be present and not be an empty string. The tag value must be present but can be an empty string.

    

  
    - *(dict) --* 

      A structure containing a tag. A tag is metadata that you can attach to your resources to help organize and categorize them. You can also use them to help you secure your resources. For more information, see `Controlling access to Amazon Web Services resources using tags <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_tags.html>`__.

       

      For more information about tags, see `Tagging Amazon Web Services resources <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html>`__ in the *Amazon Web Services General Reference Guide*.

      

    
      - **key** *(string) --* 

        The key, or name, attached to the tag. Every tag must have a key. Key names are case sensitive.

        

      
      - **value** *(string) --* 

        The string value attached to the tag. The value can be an empty string. Key values are case sensitive.

        

      
    

  :type resourceArn: string
  :param resourceArn: 

    Specifies the `Amazon Resource Name (ARN) <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html>`__ of the managed permission that you want to add tags to. You must specify *either* ``resourceArn``, or ``resourceShareArn``, but not both.

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`RAM.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`RAM.Client.exceptions.MalformedArnException`

  
  *   :py:class:`RAM.Client.exceptions.UnknownResourceException`

  
  *   :py:class:`RAM.Client.exceptions.TagLimitExceededException`

  
  *   :py:class:`RAM.Client.exceptions.ResourceArnNotFoundException`

  
  *   :py:class:`RAM.Client.exceptions.TagPolicyViolationException`

  
  *   :py:class:`RAM.Client.exceptions.ServerInternalException`

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

  