DescribeAutoScalingInstancesCommand

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

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { AutoScalingClient, DescribeAutoScalingInstancesCommand } from "@aws-sdk/client-auto-scaling"; // ES Modules import
// const { AutoScalingClient, DescribeAutoScalingInstancesCommand } = require("@aws-sdk/client-auto-scaling"); // CommonJS import
const client = new AutoScalingClient(config);
const input = { // DescribeAutoScalingInstancesType
  InstanceIds: [ // InstanceIds
    "STRING_VALUE",
  ],
  MaxRecords: Number("int"),
  NextToken: "STRING_VALUE",
};
const command = new DescribeAutoScalingInstancesCommand(input);
const response = await client.send(command);
// { // AutoScalingInstancesType
//   AutoScalingInstances: [ // AutoScalingInstances
//     { // AutoScalingInstanceDetails
//       InstanceId: "STRING_VALUE", // required
//       InstanceType: "STRING_VALUE",
//       AutoScalingGroupName: "STRING_VALUE", // required
//       AvailabilityZone: "STRING_VALUE", // required
//       LifecycleState: "STRING_VALUE", // required
//       HealthStatus: "STRING_VALUE", // required
//       LaunchConfigurationName: "STRING_VALUE",
//       LaunchTemplate: { // LaunchTemplateSpecification
//         LaunchTemplateId: "STRING_VALUE",
//         LaunchTemplateName: "STRING_VALUE",
//         Version: "STRING_VALUE",
//       },
//       ProtectedFromScaleIn: true || false, // required
//       WeightedCapacity: "STRING_VALUE",
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

Example Usage

 There was an error loading the code editor. Retry

DescribeAutoScalingInstancesCommand Input

Parameter
Type
Description
InstanceIds
string[] | undefined

The IDs of the instances. If you omit this property, all Auto Scaling instances are described. If you specify an ID that does not exist, it is ignored with no error.

Array Members: Maximum number of 50 items.

MaxRecords
number | undefined

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

NextToken
string | undefined

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

DescribeAutoScalingInstancesCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
AutoScalingInstances
AutoScalingInstanceDetails[] | undefined

The instances.

NextToken
string | undefined

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.

Throws

Name
Fault
Details
InvalidNextToken
client

The NextToken value is not valid.

ResourceContentionFault
server

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

AutoScalingServiceException
Base exception class for all service exceptions from AutoScaling service.