:doc:`PI <../../pi>` / Client / tag_resource

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



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

  

  Adds metadata tags to the Amazon RDS Performance Insights resource.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/pi-2018-02-27/TagResource>`_  


  **Request Syntax**
  ::

    response = client.tag_resource(
        ServiceType='RDS'|'DOCDB',
        ResourceARN='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type ServiceType: string
  :param ServiceType: **[REQUIRED]** 

    The Amazon Web Services service for which Performance Insights returns metrics. Valid value is ``RDS``.

    

  
  :type ResourceARN: string
  :param ResourceARN: **[REQUIRED]** 

    The Amazon RDS Performance Insights resource that the tags are added to. This value is an Amazon Resource Name (ARN). For information about creating an ARN, see `Constructing an RDS Amazon Resource Name (ARN) <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing>`__.

    

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

    The metadata assigned to an Amazon RDS resource consisting of a key-value pair.

    

  
    - *(dict) --* 

      Metadata assigned to an Amazon RDS resource consisting of a key-value pair.

      

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

        A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and can't be prefixed with ``aws:`` or ``rds:``. The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: ``"^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"``).

        

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

        A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and can't be prefixed with ``aws:`` or ``rds:``. The string can only contain only the set of Unicode letters, digits, white-space, '_', '.', ':', '/', '=', '+', '-', '@' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$").

        

      
    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`PI.Client.exceptions.InvalidArgumentException`

  
  *   :py:class:`PI.Client.exceptions.InternalServiceError`

  
  *   :py:class:`PI.Client.exceptions.NotAuthorizedException`

  