ListTagsForResource - Application Auto Scaling
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

Returns all the tags on the specified Application Auto Scaling scalable target.

For general information about tags, including the format and syntax, see Tagging your Amazon resources in the Amazon Web Services General Reference.

Request Syntax

{ "ResourceARN": "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

Specify the ARN of the scalable target.

For example: arn:aws:application-autoscaling:us-east-1:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123

To get the ARN for a scalable target, use DescribeScalableTargets.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1011.

Pattern: ^arn:.+:application-autoscaling:.+:[0-9]+:scalable-target\/[a-zA-Z0-9-]+$

Required: Yes

Response Syntax

{ "Tags": { "string" : "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.

Tags

A list of tags. Each tag consists of a tag key and a tag value.

Type: String to string map

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Errors

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

ResourceNotFoundException

The specified resource doesn't exist.

HTTP Status Code: 400

Examples

If you plan to create requests manually, you must replace the Authorization header contents in the examples (AUTHPARAMS) with a signature. For more information, see Signing Amazon API requests in the IAM User Guide. If you plan to use the Amazon CLI or one of the Amazon SDKs, these tools sign the requests for you.

Example

The following example lists the tag key names and values that are attached to the scalable target specified by its ARN.

Sample Request

POST / HTTP/1.1 Host: application-autoscaling.us-west-2.amazonaws.com Accept-Encoding: identity Content-Length: [content-length] X-Amz-Target: AnyScaleFrontendService.ListTagsForResource X-Amz-Date: 20230206T120729Z User-Agent: aws-cli/2.0.0 Python/3.7.5 Windows/10 botocore/2.0.0dev4 Content-Type: application/x-amz-json-1.1 Authorization: AUTHPARAMS { "ResourceARN": "arn:aws:application-autoscaling:us-west-2:123456789012:scalable-target/1234abcd56ab78cd901ef1234567890ab123" }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: [request-id] Content-Type: application/x-amz-json-1.1 Content-Length: 47 Date: Mon, 06 February 2023 12:07:29 GMT { "Tags": { "environment": "production" } }

See Also

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