ListTagsForResource - AWS Database Migration Service

ListTagsForResource

Lists all metadata tags attached to an AWS DMS resource, including replication instance, endpoint, security 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 AWS 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 AWS 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.

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 AWS SDKs, see the following: