RDS / Client / add_tags_to_resource

add_tags_to_resource#

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 Amazon RDS resources, see Tagging Amazon RDS Resources.

See also: AWS API Documentation

Request Syntax

response = client.add_tags_to_resource(
    ResourceName='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
Parameters:
  • ResourceName (string) –

    [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).

  • Tags (list) –

    [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 in the Amazon RDS 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

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': {
        '...': '...',
    },
}