- Documentation
Elastic Compute Service
Elastic Compute Service
API Reference
Tags
DescribeTags - Queries tagged resources (earlier version)
Tags
DescribeTags - Queries tagged resources (earlier version)
DescribeTags - Queries tagged resources (earlier version)
Call the DescribeTags operation to query resources associated with tags.
Usage notes
warning
This page describes the tag-targeted operation of the earlier version, which may no longer be maintained in the future. The new version of tag-targeted interfaces supports more scenarios. We recommend new users use the following new versions of the interfaces. Learn more. Usage notes
- This operation supports a maximum of 10 tags per query.
- You can query up to three tag values for the same tag key.
Debugging
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
Request parameters
Only the request parameters specific to this operation and some common parameters are listed below. For more information, refer to Common parameters. Action string required Sample value: DescribeTags
The action that you want to perform. Value: DescribeTags.
Version string required Sample value: 2020-04-01
The version of the API. Valid value: 2020-04-01.
MaxResults integer Optional Sample value: 10
The number of entries returned on each page in a pagination query.
NextToken string Optional Sample value: bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq******
Pagination token marking the query position. Omit this parameter for initial API requests. In the next query, set the NextToken parameter to the value returned by the previous API call.
ResourceIds.N string[] Optional Sample value: ResourceIds.1=i-l8u0p77yseabkpak****&ResourceIds.2=i-l8u0p7xyseabkbak****
The resource ID.
- Argument - N: indicates the serial number of the resource. Valid range: 1-50.
- Separate resources with &.
ResourceType string required Sample value: instance
The resource type. Valid values:
- reservedinstance: Reserved Instances (RI)
- scheduledinstance: Elastic Scheduled Instances (ESI)
TagFilters.N.Key string[] Optional Sample value: TagFilters.1.Key=k1
The specified tag key when querying resources based on tags.
- Argument - N: specifies the serial number of the tag key. Valid range: 1–10.
- Separate multiple tag keys with "&". Duplicate tag keys are not allowed.
tip
- If you do not pass in the parameter, all tags are queried.
- When an empty string is passed in, the error code InvalidTagFilterKey.Malformed is returned.
TagFilters.N.Values.N string[] Optional Sample value: TagFilters.1.Values.1=v1&TagFilters.1.Values.2=v2
The specified tag value when querying resources based on tags.
- The first N: specifies the serial number of the tag key. Value range: 1–10.
- The second N: specifies the serial number of a tag value. Value range: 1–3.
- Separate multi values with ampersands (&).
tip
- To pass in this parameter, pass in TagFilters.N.Key first.
- If you do not pass in the TagFilters.N.Key parameter, all tag values corresponding to the same tag key are queried.
- If you specify an empty string, you query tags with an empty tag value.
Response parameters
Only the response parameters specific to this operation are listed below. For more information, refer to the response structure. NextToken string Sample value: bHpwdXJja2RxemU1eG5sb3NzdGcW1-RCEq******
The query credentials value returned by this call. If null is returned, this page is the last page.
TagResources object[] Sample value: --
This parameter contains resource information and associated tags.
ResourceId string Sample value: i-l8u0p77yseabkpak****
The resource ID.
ResourceType string Sample value: instance
Resource type.
TagKey string Sample value: k1
The key of the tag associated with the resource.
TagValue string Sample value: v1
The value of the tag associated with the resource.
ResourceId string Sample value: i-l8u0p77yseabkpak****
The resource ID.
ResourceType string Sample value: instance
Resource type.
TagKey string Sample value: k1
The key of the tag associated with the resource.
TagValue string Sample value: v1
The value of the tag associated with the resource.
Sample request
Sample response
Error codes
The table below lists the business-related error codes of the operation. For more information, refer to Common error codes.
Last updated: 2026.06.18 17:48:24