DatabaseMigrationService / Client / list_tags_for_resource

list_tags_for_resource#

DatabaseMigrationService.Client.list_tags_for_resource(**kwargs)#

Lists all metadata tags attached to an DMS resource, including replication instance, endpoint, subnet group, and migration task. For more information, see Tag data type description.

See also: AWS API Documentation

Request Syntax

response = client.list_tags_for_resource(
    ResourceArn='string',
    ResourceArnList=[
        'string',
    ]
)
Parameters:
  • ResourceArn (string) – The Amazon Resource Name (ARN) string that uniquely identifies the DMS resource to list tags for. This returns a list of keys (names of tags) created for the resource and their associated tag values.

  • ResourceArnList (list) –

    List of ARNs that identify multiple DMS resources that you want to list tags for. This returns a list of keys (tag names) and their associated tag values. It also returns each tag’s associated ResourceArn value, which is the ARN of the resource for which each listed tag is created.

    • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'TagList': [
        {
            'Key': 'string',
            'Value': 'string',
            'ResourceArn': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • TagList (list) –

      A list of tags for the resource.

      • (dict) –

        A user-defined key-value pair that describes metadata added to an DMS resource and that is used by operations such as the following:

        • AddTagsToResource

        • ListTagsForResource

        • RemoveTagsFromResource

        • Key (string) –

          A key is the required name of the tag. The string value can be 1-128 Unicode characters in length and can’t be prefixed with “aws:” or “dms:”. The string can only contain only the set of Unicode letters, digits, white-space, ‘_’, ‘.’, ‘/’, ‘=’, ‘+’, ‘-’ (Java regular expressions: “^([\p{L}\p{Z}\p{N}_.:/=+\-]*)$”).

        • Value (string) –

          A value is the optional value of the tag. The string value can be 1-256 Unicode characters in length and can’t be prefixed with “aws:” or “dms:”. The string can only contain only the set of Unicode letters, digits, white-space, ‘_’, ‘.’, ‘/’, ‘=’, ‘+’, ‘-’ (Java regular expressions: “^([\p{L}\p{Z}\p{N}_.:/=+\-]*)$”).

        • ResourceArn (string) –

          The Amazon Resource Name (ARN) string that uniquely identifies the resource for which the tag is created.

Exceptions

  • DatabaseMigrationService.Client.exceptions.ResourceNotFoundFault

  • DatabaseMigrationService.Client.exceptions.InvalidResourceStateFault

Examples

Lists all tags for an AWS DMS resource.

response = client.list_tags_for_resource(
    ResourceArn='',
)

print(response)

Expected Output:

{
    'TagList': [
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}