:doc:`RDS <../../rds>` / Client / add_tags_to_resource

********************
add_tags_to_resource
********************



.. py:method:: RDS.Client.add_tags_to_resource(**kwargs)

  

  Adds metadata tags to an Amazon RDS resource. These tags can also be used with cost allocation reporting to track cost associated with Amazon RDS resources, or used in a Condition statement in an IAM policy for Amazon RDS.

   

  For an overview on tagging your relational database resources, see `Tagging Amazon RDS Resources <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html>`__ or `Tagging Amazon Aurora and Amazon RDS Resources <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/AddTagsToResource>`_  


  **Request Syntax**
  ::

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

    The Amazon RDS 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 tags to be assigned to the Amazon RDS resource.

    

  
    - *(dict) --* 

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

       

      For more information, see `Tagging Amazon RDS resources <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html>`__ in the *Amazon RDS User Guide* or `Tagging Amazon Aurora and Amazon RDS resources <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html>`__ in the *Amazon Aurora User Guide*.

      

    
      - **Key** *(string) --* 

        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) --* 

        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}_.:/=+\\-@]*)$").

        

      
    

  
  :returns: None
  **Exceptions**
  
  *   :py:class:`RDS.Client.exceptions.DBProxyNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.DBSnapshotTenantDatabaseNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.IntegrationNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.TenantDatabaseNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.BlueGreenDeploymentNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.DBSnapshotNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.DBProxyEndpointNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.InvalidDBClusterEndpointStateFault`

  
  *   :py:class:`RDS.Client.exceptions.InvalidDBInstanceStateFault`

  
  *   :py:class:`RDS.Client.exceptions.DBShardGroupNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.DBClusterNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.DBInstanceNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.DBProxyTargetGroupNotFoundFault`

  
  *   :py:class:`RDS.Client.exceptions.InvalidDBClusterStateFault`

  

  **Examples**

  This example adds a tag to an option group.
  ::

    response = client.add_tags_to_resource(
        ResourceName='arn:aws:rds:us-east-1:992648334831:og:mymysqloptiongroup',
        Tags=[
            {
                'Key': 'Staging',
                'Value': 'LocationDB',
            },
        ],
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'ResponseMetadata': {
            '...': '...',
        },
    }

  