ListTagsForResource - Amazon Database Migration Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

ListTagsForResource

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

Request Syntax

{ "ResourceArn": "string", "ResourceArnList": [ "string" ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ResourceArn

The Amazon Resource Name (ARN) string that uniquely identifies the Amazon DMS resource to list tags for. This returns a list of keys (names of tags) created for the resource and their associated tag values.

Type: String

Required: No

ResourceArnList

List of ARNs that identify multiple Amazon 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.

Type: Array of strings

Required: No

Response Syntax

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

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

TagList

A list of tags for the resource.

Type: Array of Tag objects

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidResourceStateFault

The resource is in a state that prevents it from being used for database migration.

HTTP Status Code: 400

ResourceNotFoundFault

The resource could not be found.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of ListTagsForResource.

Sample Request

POST / HTTP/1.1 Host: dms.<region>.<domain> x-amz-Date: <Date> Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user- agent;x-amz-date;x-amz-target;x-amzn- requestid,Signature=<Signature> User-Agent: <UserAgentString> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Connection: Keep-Alive X-Amz-Target: AmazonDMSv20160101.ListTagsForResource { "ResourceArn":"arn:aws:dms:us-east- 1:123456789012:rep:PWEBBEUNOLU7VEB2OHTEH4I4GQ" }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: <RequestId> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Date: <Date> { "TagList":[ { "Value":"1234", "Key":"CostCenter" } ] }

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: