AutoScaling / Client / describe_auto_scaling_instances
describe_auto_scaling_instances#
- AutoScaling.Client.describe_auto_scaling_instances(**kwargs)#
Gets information about the Auto Scaling instances in the account and Region.
See also: AWS API Documentation
Request Syntax
response = client.describe_auto_scaling_instances( InstanceIds=[ 'string', ], MaxRecords=123, NextToken='string' )
- Parameters:
InstanceIds (list) –
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.
(string) –
MaxRecords (integer) – The maximum number of items to return with this call. The default value is
50
and the maximum value is50
.NextToken (string) – The token for the next set of items to return. (You received this token from a previous call.)
- Return type:
dict
- Returns:
Response Syntax
{ 'AutoScalingInstances': [ { 'InstanceId': 'string', 'InstanceType': 'string', 'AutoScalingGroupName': 'string', 'AvailabilityZone': 'string', 'LifecycleState': 'string', 'HealthStatus': 'string', 'LaunchConfigurationName': 'string', 'LaunchTemplate': { 'LaunchTemplateId': 'string', 'LaunchTemplateName': 'string', 'Version': 'string' }, 'ProtectedFromScaleIn': True|False, 'WeightedCapacity': 'string' }, ], 'NextToken': 'string' }
Response Structure
(dict) –
AutoScalingInstances (list) –
The instances.
(dict) –
Describes an EC2 instance associated with an Auto Scaling group.
InstanceId (string) –
The ID of the instance.
InstanceType (string) –
The instance type of the EC2 instance.
AutoScalingGroupName (string) –
The name of the Auto Scaling group for the instance.
AvailabilityZone (string) –
The Availability Zone for the instance.
LifecycleState (string) –
The lifecycle state for the instance. The
Quarantined
state is not used. For information about lifecycle states, see Instance lifecycle in the Amazon EC2 Auto Scaling User Guide.Valid values:
Pending
|Pending:Wait
|Pending:Proceed
|Quarantined
|InService
|Terminating
|Terminating:Wait
|Terminating:Proceed
|Terminated
|Detaching
|Detached
|EnteringStandby
|Standby
|Warmed:Pending
|Warmed:Pending:Wait
|Warmed:Pending:Proceed
|Warmed:Terminating
|Warmed:Terminating:Wait
|Warmed:Terminating:Proceed
|Warmed:Terminated
|Warmed:Stopped
|Warmed:Running
HealthStatus (string) –
The last reported health status of this instance.
Healthy
means that the instance is healthy and should remain in service.Unhealthy
means that the instance is unhealthy and Amazon EC2 Auto Scaling should terminate and replace it.LaunchConfigurationName (string) –
The launch configuration used to launch the instance. This value is not available if you attached the instance to the Auto Scaling group.
LaunchTemplate (dict) –
The launch template for the instance.
LaunchTemplateId (string) –
The ID of the launch template. To get the template ID, use the Amazon EC2 DescribeLaunchTemplates API operation. New launch templates can be created using the Amazon EC2 CreateLaunchTemplate API.
Conditional: You must specify either a
LaunchTemplateId
or aLaunchTemplateName
.LaunchTemplateName (string) –
The name of the launch template. To get the template name, use the Amazon EC2 DescribeLaunchTemplates API operation. New launch templates can be created using the Amazon EC2 CreateLaunchTemplate API.
Conditional: You must specify either a
LaunchTemplateId
or aLaunchTemplateName
.Version (string) –
The version number,
$Latest
, or$Default
. To get the version number, use the Amazon EC2 DescribeLaunchTemplateVersions API operation. New launch template versions can be created using the Amazon EC2 CreateLaunchTemplateVersion API. If the value is$Latest
, Amazon EC2 Auto Scaling selects the latest version of the launch template when launching instances. If the value is$Default
, Amazon EC2 Auto Scaling selects the default version of the launch template when launching instances. The default value is$Default
.
ProtectedFromScaleIn (boolean) –
Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in.
WeightedCapacity (string) –
The number of capacity units contributed by the instance based on its instance type.
Valid Range: Minimum value of 1. Maximum value of 999.
NextToken (string) –
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.
Exceptions
AutoScaling.Client.exceptions.InvalidNextToken
AutoScaling.Client.exceptions.ResourceContentionFault
Examples
This example describes the specified Auto Scaling instance.
response = client.describe_auto_scaling_instances( InstanceIds=[ 'i-4ba0837f', ], ) print(response)
Expected Output:
{ 'AutoScalingInstances': [ { 'AutoScalingGroupName': 'my-auto-scaling-group', 'AvailabilityZone': 'us-west-2c', 'HealthStatus': 'HEALTHY', 'InstanceId': 'i-4ba0837f', 'LaunchConfigurationName': 'my-launch-config', 'LifecycleState': 'InService', 'ProtectedFromScaleIn': False, }, ], 'ResponseMetadata': { '...': '...', }, }