- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
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
DescribeAutoScalingInstancesCommand Input
Parameter | Type | Description |
---|
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 |
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 |
---|
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 |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidNextToken | client | The |
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. |