DescribeAutoScalingGroups - Amazon EC2 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.

DescribeAutoScalingGroups

Gets information about the Auto Scaling groups in the account and Region.

If you specify Auto Scaling group names, the output includes information for only the specified Auto Scaling groups. If you specify filters, the output includes information for only those Auto Scaling groups that meet the filter criteria. If you do not specify group names or filters, the output includes information for all Auto Scaling groups.

This operation also returns information about instances in Auto Scaling groups. To retrieve information about the instances in a warm pool, you must call the DescribeWarmPool API.

Request Parameters

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

AutoScalingGroupNames.member.N

The names of the Auto Scaling groups. By default, you can only specify up to 50 names. You can optionally increase this limit using the MaxRecords property.

If you omit this property, all Auto Scaling groups are described.

Type: Array of strings

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

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

Filters.member.N

One or more filters to limit the results based on specific tags.

Type: Array of Filter objects

Required: No

MaxRecords

The maximum number of items to return with this call. The default value is 50 and the maximum value is 100.

Type: Integer

Required: No

NextToken

The token for the next set of items to return. (You received this token from a previous call.)

Type: String

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Required: No

Response Elements

The following elements are returned by the service.

AutoScalingGroups.member.N

The groups.

Type: Array of AutoScalingGroup objects

NextToken

A string that indicates that the response contains more items than can be returned in a single response. To receive additional items, specify this string for the NextToken value when requesting the next set of items. This value is null when there are no more items to return.

Type: String

Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Errors

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

InvalidNextToken

The NextToken value is not valid.

HTTP Status Code: 400

ResourceContention

You already have a pending update to an Amazon EC2 Auto Scaling resource (for example, an Auto Scaling group, instance, or load balancer).

HTTP Status Code: 500

Examples

Example 1: Describe an Auto Scaling group

This example describes the specified Auto Scaling group.

Sample Request

https://autoscaling.amazonaws.com/?Action=DescribeAutoScalingGroups &AutoScalingGroupNames.member.1=my-asg &Version=2011-01-01 &AUTHPARAMS

Sample Response

<DescribeAutoScalingGroupsResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/"> <DescribeAutoScalingGroupsResult> <AutoScalingGroups> <member> <HealthCheckType>ELB</HealthCheckType> <LoadBalancerNames> <member>my-loadbalancer</member> </LoadBalancerNames> <Instances> <member> <LaunchConfigurationName>my-lc</LaunchConfigurationName> <LifecycleState>InService</LifecycleState> <InstanceId>i-1234567890abcdef0</InstanceId> <ProtectedFromScaleIn>false</ProtectedFromScaleIn> <AvailabilityZone>us-east-1c</AvailabilityZone> </member> </Instances> <TerminationPolicies> <member>Default</member> </TerminationPolicies> <DefaultCooldown>300</DefaultCooldown> <AutoScalingGroupARN>arn:aws:autoscaling:us-east-1:123456789012:autoScalingGroup:12345678-1234-1234-1234-123456789012:autoScalingGroupName/my-asg</AutoScalingGroupARN> <EnabledMetrics /> <AvailabilityZones> <member>us-east-1b</member> <member>us-east-1a</member> </AvailabilityZones> <Tags> <member> <ResourceId>my-asg</ResourceId> <PropagateAtLaunch>true</PropagateAtLaunch> <Value>test</Value> <Key>environment</Key> <ResourceType>auto-scaling-group</ResourceType> </member> </Tags> <LaunchConfigurationName>my-lc</LaunchConfigurationName> <AutoScalingGroupName>my-asg</AutoScalingGroupName> <HealthCheckGracePeriod>300</HealthCheckGracePeriod> <NewInstancesProtectedFromScaleIn>false</NewInstancesProtectedFromScaleIn> <SuspendedProcesses /> <CreatedTime>2022-05-06T17:47:15.107Z</CreatedTime> <MinSize>2</MinSize> <MaxSize>10</MaxSize> <DesiredCapacity>2</DesiredCapacity> <VPCZoneIdentifier>subnet-057fa0918fEXAMPLE,subnet-610acd08EXAMPLE</VPCZoneIdentifier> </member> </AutoScalingGroups> </DescribeAutoScalingGroupsResult> <ResponseMetadata> <RequestId>7c6e177f-f082-11e1-ac58-3714bEXAMPLE</RequestId> </ResponseMetadata> </DescribeAutoScalingGroupsResponse>

Example 2: Describe Auto Scaling groups with a specific tag key and value pair

This example describes any Auto Scaling groups with the tag key and value pair of environment=production.

Sample Request

https://autoscaling.amazonaws.com/?Action=DescribeAutoScalingGroups &Filters.member.1.Name=tag-key &Filters.member.1.Values.member.1=environment &Filters.member.2.Name=tag-value &Filters.member.2.Values.member.1=production &Version=2011-01-01 &AUTHPARAMS

Example 3: Describe Auto Scaling groups with tags that match multiple tag keys and values

This example combines filters to do more complex filtering. It describes any Auto Scaling groups with a specific set of tags. One tag key is environment and the tag value is production or development, and the other tag key is costcenter and the tag value is cc123.

Sample Request

https://autoscaling.amazonaws.com/?Action=DescribeAutoScalingGroups &Filter.member.1.Name=tag:environment &Filter.member.1.Values.member.1=production &Filter.member.1.Values.member.2=development &Filter.member.2.Name=tag:costcenter &Filter.member.2.Values.member.1=cc123 &Version=2011-01-01 &AUTHPARAMS

See Also

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