Table of Contents
AutoScaling.Client¶A low-level client representing Auto Scaling:
client = session.create_client('autoscaling')
These are the available methods:
attach_instances()attach_load_balancer_target_groups()attach_load_balancers()can_paginate()complete_lifecycle_action()create_auto_scaling_group()create_launch_configuration()create_or_update_tags()delete_auto_scaling_group()delete_launch_configuration()delete_lifecycle_hook()delete_notification_configuration()delete_policy()delete_scheduled_action()delete_tags()describe_account_limits()describe_adjustment_types()describe_auto_scaling_groups()describe_auto_scaling_instances()describe_auto_scaling_notification_types()describe_launch_configurations()describe_lifecycle_hook_types()describe_lifecycle_hooks()describe_load_balancer_target_groups()describe_load_balancers()describe_metric_collection_types()describe_notification_configurations()describe_policies()describe_scaling_activities()describe_scaling_process_types()describe_scheduled_actions()describe_tags()describe_termination_policy_types()detach_instances()detach_load_balancer_target_groups()detach_load_balancers()disable_metrics_collection()enable_metrics_collection()enter_standby()execute_policy()exit_standby()generate_presigned_url()get_paginator()get_waiter()put_lifecycle_hook()put_notification_configuration()put_scaling_policy()put_scheduled_update_group_action()record_lifecycle_action_heartbeat()resume_processes()set_desired_capacity()set_instance_health()set_instance_protection()suspend_processes()terminate_instance_in_auto_scaling_group()update_auto_scaling_group()attach_instances(**kwargs)¶Attaches one or more EC2 instances to the specified Auto Scaling group.
When you attach instances, Auto Scaling increases the desired capacity of the group by the number of instances being attached. If the number of instances being attached plus the desired capacity of the group exceeds the maximum size of the group, the operation fails.
If there is a Classic Load Balancer attached to your Auto Scaling group, the instances are also registered with the load balancer. If there are target groups attached to your Auto Scaling group, the instances are also registered with the target groups.
For more information, see Attach EC2 Instances to Your Auto Scaling Group in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.attach_instances(
InstanceIds=[
'string',
],
AutoScalingGroupName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example attaches the specified instance to the specified Auto Scaling group.
response = client.attach_instances(
AutoScalingGroupName='my-auto-scaling-group',
InstanceIds=[
'i-93633f9b',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
attach_load_balancer_target_groups(**kwargs)¶Attaches one or more target groups to the specified Auto Scaling group.
To describe the target groups for an Auto Scaling group, use DescribeLoadBalancerTargetGroups . To detach the target group from the Auto Scaling group, use DetachLoadBalancerTargetGroups .
For more information, see Attach a Load Balancer to Your Auto Scaling Group in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.attach_load_balancer_target_groups(
AutoScalingGroupName='string',
TargetGroupARNs=[
'string',
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
This example attaches the specified target group to the specified Auto Scaling group.
response = client.attach_load_balancer_target_groups(
AutoScalingGroupName='my-auto-scaling-group',
TargetGroupARNs=[
'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
attach_load_balancers(**kwargs)¶Attaches one or more Classic Load Balancers to the specified Auto Scaling group.
To attach an Application Load Balancer instead, see AttachLoadBalancerTargetGroups .
To describe the load balancers for an Auto Scaling group, use DescribeLoadBalancers . To detach the load balancer from the Auto Scaling group, use DetachLoadBalancers .
For more information, see Attach a Load Balancer to Your Auto Scaling Group in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.attach_load_balancers(
AutoScalingGroupName='string',
LoadBalancerNames=[
'string',
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
This example attaches the specified load balancer to the specified Auto Scaling group.
response = client.attach_load_balancers(
AutoScalingGroupName='my-auto-scaling-group',
LoadBalancerNames=[
'my-load-balancer',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
can_paginate(operation_name)¶Check if an operation can be paginated.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Returns: | True if the operation can be paginated,
False otherwise. |
complete_lifecycle_action(**kwargs)¶Completes the lifecycle action for the specified token or instance with the specified result.
This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:
For more information, see Auto Scaling Lifecycle in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.complete_lifecycle_action(
LifecycleHookName='string',
AutoScalingGroupName='string',
LifecycleActionToken='string',
LifecycleActionResult='string',
InstanceId='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
This example notifies Auto Scaling that the specified lifecycle action is complete so that it can finish launching or terminating the instance.
response = client.complete_lifecycle_action(
AutoScalingGroupName='my-auto-scaling-group',
LifecycleActionResult='CONTINUE',
LifecycleActionToken='bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635',
LifecycleHookName='my-lifecycle-hook',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
create_auto_scaling_group(**kwargs)¶Creates an Auto Scaling group with the specified name and attributes.
If you exceed your maximum limit of Auto Scaling groups, which by default is 20 per region, the call fails. For information about viewing and updating this limit, see DescribeAccountLimits .
For more information, see Auto Scaling Groups in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_auto_scaling_group(
AutoScalingGroupName='string',
LaunchConfigurationName='string',
InstanceId='string',
MinSize=123,
MaxSize=123,
DesiredCapacity=123,
DefaultCooldown=123,
AvailabilityZones=[
'string',
],
LoadBalancerNames=[
'string',
],
TargetGroupARNs=[
'string',
],
HealthCheckType='string',
HealthCheckGracePeriod=123,
PlacementGroup='string',
VPCZoneIdentifier='string',
TerminationPolicies=[
'string',
],
NewInstancesProtectedFromScaleIn=True|False,
Tags=[
{
'ResourceId': 'string',
'ResourceType': 'string',
'Key': 'string',
'Value': 'string',
'PropagateAtLaunch': True|False
},
]
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example creates an Auto Scaling group.
response = client.create_auto_scaling_group(
AutoScalingGroupName='my-auto-scaling-group',
LaunchConfigurationName='my-launch-config',
MaxSize=3,
MinSize=1,
VPCZoneIdentifier='subnet-4176792c',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example creates an Auto Scaling group and attaches the specified Classic Load Balancer.
response = client.create_auto_scaling_group(
AutoScalingGroupName='my-auto-scaling-group',
AvailabilityZones=[
'us-west-2c',
],
HealthCheckGracePeriod=120,
HealthCheckType='ELB',
LaunchConfigurationName='my-launch-config',
LoadBalancerNames=[
'my-load-balancer',
],
MaxSize=3,
MinSize=1,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example creates an Auto Scaling group and attaches the specified target group.
response = client.create_auto_scaling_group(
AutoScalingGroupName='my-auto-scaling-group',
HealthCheckGracePeriod=120,
HealthCheckType='ELB',
LaunchConfigurationName='my-launch-config',
MaxSize=3,
MinSize=1,
TargetGroupARNs=[
'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067',
],
VPCZoneIdentifier='subnet-4176792c, subnet-65ea5f08',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
create_launch_configuration(**kwargs)¶Creates a launch configuration.
If you exceed your maximum limit of launch configurations, which by default is 100 per region, the call fails. For information about viewing and updating this limit, see DescribeAccountLimits .
For more information, see Launch Configurations in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_launch_configuration(
LaunchConfigurationName='string',
ImageId='string',
KeyName='string',
SecurityGroups=[
'string',
],
ClassicLinkVPCId='string',
ClassicLinkVPCSecurityGroups=[
'string',
],
UserData='string',
InstanceId='string',
InstanceType='string',
KernelId='string',
RamdiskId='string',
BlockDeviceMappings=[
{
'VirtualName': 'string',
'DeviceName': 'string',
'Ebs': {
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'string',
'DeleteOnTermination': True|False,
'Iops': 123,
'Encrypted': True|False
},
'NoDevice': True|False
},
],
InstanceMonitoring={
'Enabled': True|False
},
SpotPrice='string',
IamInstanceProfile='string',
EbsOptimized=True|False,
AssociatePublicIpAddress=True|False,
PlacementTenancy='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example creates a launch configuration.
response = client.create_launch_configuration(
IamInstanceProfile='my-iam-role',
ImageId='ami-12345678',
InstanceType='m3.medium',
LaunchConfigurationName='my-launch-config',
SecurityGroups=[
'sg-eb2af88e',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Creates or updates tags for the specified Auto Scaling group.
When you specify a tag with a key that already exists, the operation overwrites the previous tag definition, and you do not get an error message.
For more information, see Tagging Auto Scaling Groups and Instances in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_or_update_tags(
Tags=[
{
'ResourceId': 'string',
'ResourceType': 'string',
'Key': 'string',
'Value': 'string',
'PropagateAtLaunch': True|False
},
]
)
| Parameters: | Tags (list) – [REQUIRED] One or more tags.
|
|---|---|
| Returns: | None |
Examples
This example adds two tags to the specified Auto Scaling group.
response = client.create_or_update_tags(
Tags=[
{
'Key': 'Role',
'PropagateAtLaunch': True,
'ResourceId': 'my-auto-scaling-group',
'ResourceType': 'auto-scaling-group',
'Value': 'WebServer',
},
{
'Key': 'Dept',
'PropagateAtLaunch': True,
'ResourceId': 'my-auto-scaling-group',
'ResourceType': 'auto-scaling-group',
'Value': 'Research',
},
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_auto_scaling_group(**kwargs)¶Deletes the specified Auto Scaling group.
If the group has instances or scaling activities in progress, you must specify the option to force the deletion in order for it to succeed.
If the group has policies, deleting the group deletes the policies, the underlying alarm actions, and any alarm that no longer has an associated action.
To remove instances from the Auto Scaling group before deleting it, call DetachInstances with the list of instances and the option to decrement the desired capacity so that Auto Scaling does not launch replacement instances.
To terminate all instances before deleting the Auto Scaling group, call UpdateAutoScalingGroup and set the minimum size and desired capacity of the Auto Scaling group to zero.
See also: AWS API Documentation
Request Syntax
response = client.delete_auto_scaling_group(
AutoScalingGroupName='string',
ForceDelete=True|False
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example deletes the specified Auto Scaling group.
response = client.delete_auto_scaling_group(
AutoScalingGroupName='my-auto-scaling-group',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example deletes the specified Auto Scaling group and all its instances.
response = client.delete_auto_scaling_group(
AutoScalingGroupName='my-auto-scaling-group',
ForceDelete=True,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_launch_configuration(**kwargs)¶Deletes the specified launch configuration.
The launch configuration must not be attached to an Auto Scaling group. When this call completes, the launch configuration is no longer available for use.
See also: AWS API Documentation
Request Syntax
response = client.delete_launch_configuration(
LaunchConfigurationName='string'
)
| Parameters: | LaunchConfigurationName (string) – [REQUIRED] The name of the launch configuration. |
|---|---|
| Returns: | None |
Examples
This example deletes the specified launch configuration.
response = client.delete_launch_configuration(
LaunchConfigurationName='my-launch-config',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_lifecycle_hook(**kwargs)¶Deletes the specified lifecycle hook.
If there are any outstanding lifecycle actions, they are completed first (ABANDON for launching instances, CONTINUE for terminating instances).
See also: AWS API Documentation
Request Syntax
response = client.delete_lifecycle_hook(
LifecycleHookName='string',
AutoScalingGroupName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
This example deletes the specified lifecycle hook.
response = client.delete_lifecycle_hook(
AutoScalingGroupName='my-auto-scaling-group',
LifecycleHookName='my-lifecycle-hook',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_notification_configuration(**kwargs)¶Deletes the specified notification.
See also: AWS API Documentation
Request Syntax
response = client.delete_notification_configuration(
AutoScalingGroupName='string',
TopicARN='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example deletes the specified notification from the specified Auto Scaling group.
response = client.delete_notification_configuration(
AutoScalingGroupName='my-auto-scaling-group',
TopicARN='arn:aws:sns:us-west-2:123456789012:my-sns-topic',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_policy(**kwargs)¶Deletes the specified Auto Scaling policy.
Deleting a policy deletes the underlying alarm action, but does not delete the alarm, even if it no longer has an associated action.
See also: AWS API Documentation
Request Syntax
response = client.delete_policy(
AutoScalingGroupName='string',
PolicyName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example deletes the specified Auto Scaling policy.
response = client.delete_policy(
AutoScalingGroupName='my-auto-scaling-group',
PolicyName='ScaleIn',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_scheduled_action(**kwargs)¶Deletes the specified scheduled action.
See also: AWS API Documentation
Request Syntax
response = client.delete_scheduled_action(
AutoScalingGroupName='string',
ScheduledActionName='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example deletes the specified scheduled action from the specified Auto Scaling group.
response = client.delete_scheduled_action(
AutoScalingGroupName='my-auto-scaling-group',
ScheduledActionName='my-scheduled-action',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
Deletes the specified tags.
See also: AWS API Documentation
Request Syntax
response = client.delete_tags(
Tags=[
{
'ResourceId': 'string',
'ResourceType': 'string',
'Key': 'string',
'Value': 'string',
'PropagateAtLaunch': True|False
},
]
)
| Parameters: | Tags (list) – [REQUIRED] One or more tags.
|
|---|---|
| Returns: | None |
Examples
This example deletes the specified tag from the specified Auto Scaling group.
response = client.delete_tags(
Tags=[
{
'Key': 'Dept',
'ResourceId': 'my-auto-scaling-group',
'ResourceType': 'auto-scaling-group',
'Value': 'Research',
},
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
describe_account_limits()¶Describes the current Auto Scaling resource limits for your AWS account.
For information about requesting an increase in these limits, see AWS Service Limits in the Amazon Web Services General Reference .
See also: AWS API Documentation
Request Syntax
response = client.describe_account_limits()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'MaxNumberOfAutoScalingGroups': 123,
'MaxNumberOfLaunchConfigurations': 123,
'NumberOfAutoScalingGroups': 123,
'NumberOfLaunchConfigurations': 123
}
Response Structure
|
Examples
This example describes the Auto Scaling limits for your AWS account.
response = client.describe_account_limits(
)
print(response)
Expected Output:
{
'MaxNumberOfAutoScalingGroups': 20,
'MaxNumberOfLaunchConfigurations': 100,
'NumberOfAutoScalingGroups': 3,
'NumberOfLaunchConfigurations': 5,
'ResponseMetadata': {
'...': '...',
},
}
describe_adjustment_types()¶Describes the policy adjustment types for use with PutScalingPolicy .
See also: AWS API Documentation
Request Syntax
response = client.describe_adjustment_types()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'AdjustmentTypes': [
{
'AdjustmentType': 'string'
},
]
}
Response Structure
|
Examples
This example describes the available adjustment types.
response = client.describe_adjustment_types(
)
print(response)
Expected Output:
{
'AdjustmentTypes': [
{
'AdjustmentType': 'ChangeInCapacity',
},
{
'AdjustmentType': 'ExactCapcity',
},
{
'AdjustmentType': 'PercentChangeInCapacity',
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_auto_scaling_groups(**kwargs)¶Describes one or more Auto Scaling groups.
See also: AWS API Documentation
Request Syntax
response = client.describe_auto_scaling_groups(
AutoScalingGroupNames=[
'string',
],
NextToken='string',
MaxRecords=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AutoScalingGroups': [
{
'AutoScalingGroupName': 'string',
'AutoScalingGroupARN': 'string',
'LaunchConfigurationName': 'string',
'MinSize': 123,
'MaxSize': 123,
'DesiredCapacity': 123,
'DefaultCooldown': 123,
'AvailabilityZones': [
'string',
],
'LoadBalancerNames': [
'string',
],
'TargetGroupARNs': [
'string',
],
'HealthCheckType': 'string',
'HealthCheckGracePeriod': 123,
'Instances': [
{
'InstanceId': 'string',
'AvailabilityZone': 'string',
'LifecycleState': 'Pending'|'Pending:Wait'|'Pending:Proceed'|'Quarantined'|'InService'|'Terminating'|'Terminating:Wait'|'Terminating:Proceed'|'Terminated'|'Detaching'|'Detached'|'EnteringStandby'|'Standby',
'HealthStatus': 'string',
'LaunchConfigurationName': 'string',
'ProtectedFromScaleIn': True|False
},
],
'CreatedTime': datetime(2015, 1, 1),
'SuspendedProcesses': [
{
'ProcessName': 'string',
'SuspensionReason': 'string'
},
],
'PlacementGroup': 'string',
'VPCZoneIdentifier': 'string',
'EnabledMetrics': [
{
'Metric': 'string',
'Granularity': 'string'
},
],
'Status': 'string',
'Tags': [
{
'ResourceId': 'string',
'ResourceType': 'string',
'Key': 'string',
'Value': 'string',
'PropagateAtLaunch': True|False
},
],
'TerminationPolicies': [
'string',
],
'NewInstancesProtectedFromScaleIn': True|False
},
],
'NextToken': 'string'
}
Response Structure
|
Examples
This example describes the specified Auto Scaling group.
response = client.describe_auto_scaling_groups(
AutoScalingGroupNames=[
'my-auto-scaling-group',
],
)
print(response)
Expected Output:
{
'AutoScalingGroups': [
{
'AutoScalingGroupARN': 'arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:930d940e-891e-4781-a11a-7b0acd480f03:autoScalingGroupName/my-auto-scaling-group',
'AutoScalingGroupName': 'my-auto-scaling-group',
'AvailabilityZones': [
'us-west-2c',
],
'CreatedTime': datetime(2013, 8, 19, 20, 53, 25, 0, 231, 0),
'DefaultCooldown': 300,
'DesiredCapacity': 1,
'EnabledMetrics': [
],
'HealthCheckGracePeriod': 300,
'HealthCheckType': 'EC2',
'Instances': [
{
'AvailabilityZone': 'us-west-2c',
'HealthStatus': 'Healthy',
'InstanceId': 'i-4ba0837f',
'LaunchConfigurationName': 'my-launch-config',
'LifecycleState': 'InService',
},
],
'LaunchConfigurationName': 'my-launch-config',
'LoadBalancerNames': [
],
'MaxSize': 1,
'MinSize': 0,
'NewInstancesProtectedFromScaleIn': False,
'SuspendedProcesses': [
],
'Tags': [
],
'TerminationPolicies': [
'Default',
],
'VPCZoneIdentifier': 'subnet-12345678',
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_auto_scaling_instances(**kwargs)¶Describes one or more Auto Scaling instances.
See also: AWS API Documentation
Request Syntax
response = client.describe_auto_scaling_instances(
InstanceIds=[
'string',
],
MaxRecords=123,
NextToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AutoScalingInstances': [
{
'InstanceId': 'string',
'AutoScalingGroupName': 'string',
'AvailabilityZone': 'string',
'LifecycleState': 'string',
'HealthStatus': 'string',
'LaunchConfigurationName': 'string',
'ProtectedFromScaleIn': True|False
},
],
'NextToken': 'string'
}
Response Structure
|
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': {
'...': '...',
},
}
describe_auto_scaling_notification_types()¶Describes the notification types that are supported by Auto Scaling.
See also: AWS API Documentation
Request Syntax
response = client.describe_auto_scaling_notification_types()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'AutoScalingNotificationTypes': [
'string',
]
}
Response Structure
|
Examples
This example describes the available notification types.
response = client.describe_auto_scaling_notification_types(
)
print(response)
Expected Output:
{
'AutoScalingNotificationTypes': [
'autoscaling:EC2_INSTANCE_LAUNCH',
'autoscaling:EC2_INSTANCE_LAUNCH_ERROR',
'autoscaling:EC2_INSTANCE_TERMINATE',
'autoscaling:EC2_INSTANCE_TERMINATE_ERROR',
'autoscaling:TEST_NOTIFICATION',
],
'ResponseMetadata': {
'...': '...',
},
}
describe_launch_configurations(**kwargs)¶Describes one or more launch configurations.
See also: AWS API Documentation
Request Syntax
response = client.describe_launch_configurations(
LaunchConfigurationNames=[
'string',
],
NextToken='string',
MaxRecords=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'LaunchConfigurations': [
{
'LaunchConfigurationName': 'string',
'LaunchConfigurationARN': 'string',
'ImageId': 'string',
'KeyName': 'string',
'SecurityGroups': [
'string',
],
'ClassicLinkVPCId': 'string',
'ClassicLinkVPCSecurityGroups': [
'string',
],
'UserData': 'string',
'InstanceType': 'string',
'KernelId': 'string',
'RamdiskId': 'string',
'BlockDeviceMappings': [
{
'VirtualName': 'string',
'DeviceName': 'string',
'Ebs': {
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'string',
'DeleteOnTermination': True|False,
'Iops': 123,
'Encrypted': True|False
},
'NoDevice': True|False
},
],
'InstanceMonitoring': {
'Enabled': True|False
},
'SpotPrice': 'string',
'IamInstanceProfile': 'string',
'CreatedTime': datetime(2015, 1, 1),
'EbsOptimized': True|False,
'AssociatePublicIpAddress': True|False,
'PlacementTenancy': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
Examples
This example describes the specified launch configuration.
response = client.describe_launch_configurations(
LaunchConfigurationNames=[
'my-launch-config',
],
)
print(response)
Expected Output:
{
'LaunchConfigurations': [
{
'AssociatePublicIpAddress': True,
'BlockDeviceMappings': [
],
'CreatedTime': datetime(2014, 5, 7, 17, 39, 28, 2, 127, 0),
'EbsOptimized': False,
'ImageId': 'ami-043a5034',
'InstanceMonitoring': {
'Enabled': True,
},
'InstanceType': 't1.micro',
'LaunchConfigurationARN': 'arn:aws:autoscaling:us-west-2:123456789012:launchConfiguration:98d3b196-4cf9-4e88-8ca1-8547c24ced8b:launchConfigurationName/my-launch-config',
'LaunchConfigurationName': 'my-launch-config',
'SecurityGroups': [
'sg-67ef0308',
],
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_lifecycle_hook_types()¶Describes the available types of lifecycle hooks.
See also: AWS API Documentation
Request Syntax
response = client.describe_lifecycle_hook_types()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'LifecycleHookTypes': [
'string',
]
}
Response Structure
|
Examples
This example describes the available lifecycle hook types.
response = client.describe_lifecycle_hook_types(
)
print(response)
Expected Output:
{
'LifecycleHookTypes': [
'autoscaling:EC2_INSTANCE_LAUNCHING',
'autoscaling:EC2_INSTANCE_TERMINATING',
],
'ResponseMetadata': {
'...': '...',
},
}
describe_lifecycle_hooks(**kwargs)¶Describes the lifecycle hooks for the specified Auto Scaling group.
See also: AWS API Documentation
Request Syntax
response = client.describe_lifecycle_hooks(
AutoScalingGroupName='string',
LifecycleHookNames=[
'string',
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'LifecycleHooks': [
{
'LifecycleHookName': 'string',
'AutoScalingGroupName': 'string',
'LifecycleTransition': 'string',
'NotificationTargetARN': 'string',
'RoleARN': 'string',
'NotificationMetadata': 'string',
'HeartbeatTimeout': 123,
'GlobalTimeout': 123,
'DefaultResult': 'string'
},
]
}
Response Structure
|
Examples
This example describes the lifecycle hooks for the specified Auto Scaling group.
response = client.describe_lifecycle_hooks(
AutoScalingGroupName='my-auto-scaling-group',
)
print(response)
Expected Output:
{
'LifecycleHooks': [
{
'AutoScalingGroupName': 'my-auto-scaling-group',
'DefaultResult': 'ABANDON',
'GlobalTimeout': 172800,
'HeartbeatTimeout': 3600,
'LifecycleHookName': 'my-lifecycle-hook',
'LifecycleTransition': 'autoscaling:EC2_INSTANCE_LAUNCHING',
'NotificationTargetARN': 'arn:aws:sns:us-west-2:123456789012:my-sns-topic',
'RoleARN': 'arn:aws:iam::123456789012:role/my-auto-scaling-role',
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_load_balancer_target_groups(**kwargs)¶Describes the target groups for the specified Auto Scaling group.
See also: AWS API Documentation
Request Syntax
response = client.describe_load_balancer_target_groups(
AutoScalingGroupName='string',
NextToken='string',
MaxRecords=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'LoadBalancerTargetGroups': [
{
'LoadBalancerTargetGroupARN': 'string',
'State': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
Examples
This example describes the target groups attached to the specified Auto Scaling group.
response = client.describe_load_balancer_target_groups(
AutoScalingGroupName='my-auto-scaling-group',
)
print(response)
Expected Output:
{
'LoadBalancerTargetGroups': [
{
'LoadBalancerTargetGroupARN': 'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067',
'State': 'Added',
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_load_balancers(**kwargs)¶Describes the load balancers for the specified Auto Scaling group.
Note that this operation describes only Classic Load Balancers. If you have Application Load Balancers, use DescribeLoadBalancerTargetGroups instead.
See also: AWS API Documentation
Request Syntax
response = client.describe_load_balancers(
AutoScalingGroupName='string',
NextToken='string',
MaxRecords=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'LoadBalancers': [
{
'LoadBalancerName': 'string',
'State': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
Examples
This example describes the load balancers attached to the specified Auto Scaling group.
response = client.describe_load_balancers(
AutoScalingGroupName='my-auto-scaling-group',
)
print(response)
Expected Output:
{
'LoadBalancers': [
{
'LoadBalancerName': 'my-load-balancer',
'State': 'Added',
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_metric_collection_types()¶Describes the available CloudWatch metrics for Auto Scaling.
Note that the GroupStandbyInstances metric is not returned by default. You must explicitly request this metric when calling EnableMetricsCollection .
See also: AWS API Documentation
Request Syntax
response = client.describe_metric_collection_types()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'Metrics': [
{
'Metric': 'string'
},
],
'Granularities': [
{
'Granularity': 'string'
},
]
}
Response Structure
|
Examples
This example describes the available metric collection types.
response = client.describe_metric_collection_types(
)
print(response)
Expected Output:
{
'Granularities': [
{
'Granularity': '1Minute',
},
],
'Metrics': [
{
'Metric': 'GroupMinSize',
},
{
'Metric': 'GroupMaxSize',
},
{
'Metric': 'GroupDesiredCapacity',
},
{
'Metric': 'GroupInServiceInstances',
},
{
'Metric': 'GroupPendingInstances',
},
{
'Metric': 'GroupTerminatingInstances',
},
{
'Metric': 'GroupStandbyInstances',
},
{
'Metric': 'GroupTotalInstances',
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_notification_configurations(**kwargs)¶Describes the notification actions associated with the specified Auto Scaling group.
See also: AWS API Documentation
Request Syntax
response = client.describe_notification_configurations(
AutoScalingGroupNames=[
'string',
],
NextToken='string',
MaxRecords=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'NotificationConfigurations': [
{
'AutoScalingGroupName': 'string',
'TopicARN': 'string',
'NotificationType': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
Examples
This example describes the notification configurations for the specified Auto Scaling group.
response = client.describe_notification_configurations(
AutoScalingGroupNames=[
'my-auto-scaling-group',
],
)
print(response)
Expected Output:
{
'NotificationConfigurations': [
{
'AutoScalingGroupName': 'my-auto-scaling-group',
'NotificationType': 'autoscaling:TEST_NOTIFICATION',
'TopicARN': 'arn:aws:sns:us-west-2:123456789012:my-sns-topic-2',
},
{
'AutoScalingGroupName': 'my-auto-scaling-group',
'NotificationType': 'autoscaling:TEST_NOTIFICATION',
'TopicARN': 'arn:aws:sns:us-west-2:123456789012:my-sns-topic',
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_policies(**kwargs)¶Describes the policies for the specified Auto Scaling group.
See also: AWS API Documentation
Request Syntax
response = client.describe_policies(
AutoScalingGroupName='string',
PolicyNames=[
'string',
],
PolicyTypes=[
'string',
],
NextToken='string',
MaxRecords=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ScalingPolicies': [
{
'AutoScalingGroupName': 'string',
'PolicyName': 'string',
'PolicyARN': 'string',
'PolicyType': 'string',
'AdjustmentType': 'string',
'MinAdjustmentStep': 123,
'MinAdjustmentMagnitude': 123,
'ScalingAdjustment': 123,
'Cooldown': 123,
'StepAdjustments': [
{
'MetricIntervalLowerBound': 123.0,
'MetricIntervalUpperBound': 123.0,
'ScalingAdjustment': 123
},
],
'MetricAggregationType': 'string',
'EstimatedInstanceWarmup': 123,
'Alarms': [
{
'AlarmName': 'string',
'AlarmARN': 'string'
},
],
'TargetTrackingConfiguration': {
'PredefinedMetricSpecification': {
'PredefinedMetricType': 'ASGAverageCPUUtilization'|'ASGAverageNetworkIn'|'ASGAverageNetworkOut'|'ALBRequestCountPerTarget',
'ResourceLabel': 'string'
},
'CustomizedMetricSpecification': {
'MetricName': 'string',
'Namespace': 'string',
'Dimensions': [
{
'Name': 'string',
'Value': 'string'
},
],
'Statistic': 'Average'|'Minimum'|'Maximum'|'SampleCount'|'Sum',
'Unit': 'string'
},
'TargetValue': 123.0,
'DisableScaleIn': True|False
}
},
],
'NextToken': 'string'
}
Response Structure
|
Examples
This example describes the policies for the specified Auto Scaling group.
response = client.describe_policies(
AutoScalingGroupName='my-auto-scaling-group',
)
print(response)
Expected Output:
{
'ScalingPolicies': [
{
'AdjustmentType': 'ChangeInCapacity',
'Alarms': [
],
'AutoScalingGroupName': 'my-auto-scaling-group',
'PolicyARN': 'arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2233f3d7-6290-403b-b632-93c553560106:autoScalingGroupName/my-auto-scaling-group:policyName/ScaleIn',
'PolicyName': 'ScaleIn',
'ScalingAdjustment': -1,
},
{
'AdjustmentType': 'PercentChangeInCapacity',
'Alarms': [
],
'AutoScalingGroupName': 'my-auto-scaling-group',
'Cooldown': 60,
'MinAdjustmentStep': 2,
'PolicyARN': 'arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2b435159-cf77-4e89-8c0e-d63b497baad7:autoScalingGroupName/my-auto-scaling-group:policyName/ScalePercentChange',
'PolicyName': 'ScalePercentChange',
'ScalingAdjustment': 25,
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_scaling_activities(**kwargs)¶Describes one or more scaling activities for the specified Auto Scaling group.
See also: AWS API Documentation
Request Syntax
response = client.describe_scaling_activities(
ActivityIds=[
'string',
],
AutoScalingGroupName='string',
MaxRecords=123,
NextToken='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Activities': [
{
'ActivityId': 'string',
'AutoScalingGroupName': 'string',
'Description': 'string',
'Cause': 'string',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'StatusCode': 'PendingSpotBidPlacement'|'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
Examples
This example describes the scaling activities for the specified Auto Scaling group.
response = client.describe_scaling_activities(
AutoScalingGroupName='my-auto-scaling-group',
)
print(response)
Expected Output:
{
'Activities': [
{
'ActivityId': 'f9f2d65b-f1f2-43e7-b46d-d86756459699',
'AutoScalingGroupName': 'my-auto-scaling-group',
'Cause': 'At 2013-08-19T20:53:25Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 1. At 2013-08-19T20:53:29Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.',
'Description': 'Launching a new EC2 instance: i-4ba0837f',
'Details': 'details',
'EndTime': datetime(2013, 8, 19, 20, 54, 2, 0, 231, 0),
'Progress': 100,
'StartTime': datetime(2013, 8, 19, 20, 53, 29, 0, 231, 0),
'StatusCode': 'Successful',
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_scaling_process_types()¶Describes the scaling process types for use with ResumeProcesses and SuspendProcesses .
See also: AWS API Documentation
Request Syntax
response = client.describe_scaling_process_types()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'Processes': [
{
'ProcessName': 'string'
},
]
}
Response Structure
|
Examples
This example describes the Auto Scaling process types.
response = client.describe_scaling_process_types(
)
print(response)
Expected Output:
{
'Processes': [
{
'ProcessName': 'AZRebalance',
},
{
'ProcessName': 'AddToLoadBalancer',
},
{
'ProcessName': 'AlarmNotification',
},
{
'ProcessName': 'HealthCheck',
},
{
'ProcessName': 'Launch',
},
{
'ProcessName': 'ReplaceUnhealthy',
},
{
'ProcessName': 'ScheduledActions',
},
{
'ProcessName': 'Terminate',
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_scheduled_actions(**kwargs)¶Describes the actions scheduled for your Auto Scaling group that haven’t run. To describe the actions that have already run, use DescribeScalingActivities .
See also: AWS API Documentation
Request Syntax
response = client.describe_scheduled_actions(
AutoScalingGroupName='string',
ScheduledActionNames=[
'string',
],
StartTime=datetime(2015, 1, 1),
EndTime=datetime(2015, 1, 1),
NextToken='string',
MaxRecords=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ScheduledUpdateGroupActions': [
{
'AutoScalingGroupName': 'string',
'ScheduledActionName': 'string',
'ScheduledActionARN': 'string',
'Time': datetime(2015, 1, 1),
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'Recurrence': 'string',
'MinSize': 123,
'MaxSize': 123,
'DesiredCapacity': 123
},
],
'NextToken': 'string'
}
Response Structure
|
Examples
This example describes the scheduled actions for the specified Auto Scaling group.
response = client.describe_scheduled_actions(
AutoScalingGroupName='my-auto-scaling-group',
)
print(response)
Expected Output:
{
'ScheduledUpdateGroupActions': [
{
'AutoScalingGroupName': 'my-auto-scaling-group',
'DesiredCapacity': 4,
'MaxSize': 6,
'MinSize': 2,
'Recurrence': '30 0 1 12 0',
'ScheduledActionARN': 'arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-auto-scaling-group:scheduledActionName/my-scheduled-action',
'ScheduledActionName': 'my-scheduled-action',
'StartTime': datetime(2016, 12, 1, 0, 30, 0, 3, 336, 0),
'Time': datetime(2016, 12, 1, 0, 30, 0, 3, 336, 0),
},
],
'ResponseMetadata': {
'...': '...',
},
}
Describes the specified tags.
You can use filters to limit the results. For example, you can query for the tags for a specific Auto Scaling group. You can specify multiple values for a filter. A tag must match at least one of the specified values for it to be included in the results.
You can also specify multiple filters. The result includes information for a particular tag only if it matches all the filters. If there’s no match, no special message is returned.
See also: AWS API Documentation
Request Syntax
response = client.describe_tags(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
NextToken='string',
MaxRecords=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Tags': [
{
'ResourceId': 'string',
'ResourceType': 'string',
'Key': 'string',
'Value': 'string',
'PropagateAtLaunch': True|False
},
],
'NextToken': 'string'
}
Response Structure
|
Examples
This example describes the tags for the specified Auto Scaling group.
response = client.describe_tags(
Filters=[
{
'Name': 'auto-scaling-group',
'Values': [
'my-auto-scaling-group',
],
},
],
)
print(response)
Expected Output:
{
'Tags': [
{
'Key': 'Dept',
'PropagateAtLaunch': True,
'ResourceId': 'my-auto-scaling-group',
'ResourceType': 'auto-scaling-group',
'Value': 'Research',
},
{
'Key': 'Role',
'PropagateAtLaunch': True,
'ResourceId': 'my-auto-scaling-group',
'ResourceType': 'auto-scaling-group',
'Value': 'WebServer',
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_termination_policy_types()¶Describes the termination policies supported by Auto Scaling.
See also: AWS API Documentation
Request Syntax
response = client.describe_termination_policy_types()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'TerminationPolicyTypes': [
'string',
]
}
Response Structure
|
Examples
This example describes the available termination policy types.
response = client.describe_termination_policy_types(
)
print(response)
Expected Output:
{
'TerminationPolicyTypes': [
'ClosestToNextInstanceHour',
'Default',
'NewestInstance',
'OldestInstance',
'OldestLaunchConfiguration',
],
'ResponseMetadata': {
'...': '...',
},
}
detach_instances(**kwargs)¶Removes one or more instances from the specified Auto Scaling group.
After the instances are detached, you can manage them independently from the rest of the Auto Scaling group.
If you do not specify the option to decrement the desired capacity, Auto Scaling launches instances to replace the ones that are detached.
If there is a Classic Load Balancer attached to the Auto Scaling group, the instances are deregistered from the load balancer. If there are target groups attached to the Auto Scaling group, the instances are deregistered from the target groups.
For more information, see Detach EC2 Instances from Your Auto Scaling Group in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.detach_instances(
InstanceIds=[
'string',
],
AutoScalingGroupName='string',
ShouldDecrementDesiredCapacity=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Activities': [
{
'ActivityId': 'string',
'AutoScalingGroupName': 'string',
'Description': 'string',
'Cause': 'string',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'StatusCode': 'PendingSpotBidPlacement'|'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
},
]
}
Response Structure
|
Examples
This example detaches the specified instance from the specified Auto Scaling group.
response = client.detach_instances(
AutoScalingGroupName='my-auto-scaling-group',
InstanceIds=[
'i-93633f9b',
],
ShouldDecrementDesiredCapacity=True,
)
print(response)
Expected Output:
{
'Activities': [
{
'ActivityId': '5091cb52-547a-47ce-a236-c9ccbc2cb2c9',
'AutoScalingGroupName': 'my-auto-scaling-group',
'Cause': 'At 2015-04-12T15:02:16Z instance i-93633f9b was detached in response to a user request, shrinking the capacity from 2 to 1.',
'Description': 'Detaching EC2 instance: i-93633f9b',
'Details': 'details',
'Progress': 50,
'StartTime': datetime(2015, 4, 12, 15, 2, 16, 6, 102, 0),
'StatusCode': 'InProgress',
},
],
'ResponseMetadata': {
'...': '...',
},
}
detach_load_balancer_target_groups(**kwargs)¶Detaches one or more target groups from the specified Auto Scaling group.
See also: AWS API Documentation
Request Syntax
response = client.detach_load_balancer_target_groups(
AutoScalingGroupName='string',
TargetGroupARNs=[
'string',
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
This example detaches the specified target group from the specified Auto Scaling group
response = client.detach_load_balancer_target_groups(
AutoScalingGroupName='my-auto-scaling-group',
TargetGroupARNs=[
'arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
detach_load_balancers(**kwargs)¶Detaches one or more Classic Load Balancers from the specified Auto Scaling group.
Note that this operation detaches only Classic Load Balancers. If you have Application Load Balancers, use DetachLoadBalancerTargetGroups instead.
When you detach a load balancer, it enters the Removing state while deregistering the instances in the group. When all instances are deregistered, then you can no longer describe the load balancer using DescribeLoadBalancers . Note that the instances remain running.
See also: AWS API Documentation
Request Syntax
response = client.detach_load_balancers(
AutoScalingGroupName='string',
LoadBalancerNames=[
'string',
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
This example detaches the specified load balancer from the specified Auto Scaling group.
response = client.detach_load_balancers(
AutoScalingGroupName='my-auto-scaling-group',
LoadBalancerNames=[
'my-load-balancer',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
disable_metrics_collection(**kwargs)¶Disables group metrics for the specified Auto Scaling group.
See also: AWS API Documentation
Request Syntax
response = client.disable_metrics_collection(
AutoScalingGroupName='string',
Metrics=[
'string',
]
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example disables collecting data for the GroupDesiredCapacity metric for the specified Auto Scaling group.
response = client.disable_metrics_collection(
AutoScalingGroupName='my-auto-scaling-group',
Metrics=[
'GroupDesiredCapacity',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
enable_metrics_collection(**kwargs)¶Enables group metrics for the specified Auto Scaling group. For more information, see Monitoring Your Auto Scaling Groups and Instances in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.enable_metrics_collection(
AutoScalingGroupName='string',
Metrics=[
'string',
],
Granularity='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example enables data collection for the specified Auto Scaling group.
response = client.enable_metrics_collection(
AutoScalingGroupName='my-auto-scaling-group',
Granularity='1Minute',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
enter_standby(**kwargs)¶Moves the specified instances into Standby mode.
For more information, see Auto Scaling Lifecycle in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.enter_standby(
InstanceIds=[
'string',
],
AutoScalingGroupName='string',
ShouldDecrementDesiredCapacity=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Activities': [
{
'ActivityId': 'string',
'AutoScalingGroupName': 'string',
'Description': 'string',
'Cause': 'string',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'StatusCode': 'PendingSpotBidPlacement'|'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
},
]
}
Response Structure
|
Examples
This example puts the specified instance into standby mode.
response = client.enter_standby(
AutoScalingGroupName='my-auto-scaling-group',
InstanceIds=[
'i-93633f9b',
],
ShouldDecrementDesiredCapacity=True,
)
print(response)
Expected Output:
{
'Activities': [
{
'ActivityId': 'ffa056b4-6ed3-41ba-ae7c-249dfae6eba1',
'AutoScalingGroupName': 'my-auto-scaling-group',
'Cause': 'At 2015-04-12T15:10:23Z instance i-93633f9b was moved to standby in response to a user request, shrinking the capacity from 2 to 1.',
'Description': 'Moving EC2 instance to Standby: i-93633f9b',
'Details': 'details',
'Progress': 50,
'StartTime': datetime(2015, 4, 12, 15, 10, 23, 6, 102, 0),
'StatusCode': 'InProgress',
},
],
'ResponseMetadata': {
'...': '...',
},
}
execute_policy(**kwargs)¶Executes the specified policy.
See also: AWS API Documentation
Request Syntax
response = client.execute_policy(
AutoScalingGroupName='string',
PolicyName='string',
HonorCooldown=True|False,
MetricValue=123.0,
BreachThreshold=123.0
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example executes the specified Auto Scaling policy for the specified Auto Scaling group.
response = client.execute_policy(
AutoScalingGroupName='my-auto-scaling-group',
HonorCooldown=True,
PolicyName='ScaleIn',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
exit_standby(**kwargs)¶Moves the specified instances out of Standby mode.
For more information, see Auto Scaling Lifecycle in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.exit_standby(
InstanceIds=[
'string',
],
AutoScalingGroupName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Activities': [
{
'ActivityId': 'string',
'AutoScalingGroupName': 'string',
'Description': 'string',
'Cause': 'string',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'StatusCode': 'PendingSpotBidPlacement'|'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
},
]
}
Response Structure
|
Examples
This example moves the specified instance out of standby mode.
response = client.exit_standby(
AutoScalingGroupName='my-auto-scaling-group',
InstanceIds=[
'i-93633f9b',
],
)
print(response)
Expected Output:
{
'Activities': [
{
'ActivityId': '142928e1-a2dc-453a-9b24-b85ad6735928',
'AutoScalingGroupName': 'my-auto-scaling-group',
'Cause': 'At 2015-04-12T15:14:29Z instance i-93633f9b was moved out of standby in response to a user request, increasing the capacity from 1 to 2.',
'Description': 'Moving EC2 instance out of Standby: i-93633f9b',
'Details': 'details',
'Progress': 30,
'StartTime': datetime(2015, 4, 12, 15, 14, 29, 6, 102, 0),
'StatusCode': 'PreInService',
},
],
'ResponseMetadata': {
'...': '...',
},
}
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
| Parameters: |
|
|---|---|
| Returns: | The presigned url |
get_paginator(operation_name)¶Create a paginator for an operation.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Raises: | OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
| Return type: | L{botocore.paginate.Paginator} |
| Returns: | A paginator object. |
get_waiter(waiter_name)¶put_lifecycle_hook(**kwargs)¶Creates or updates a lifecycle hook for the specified Auto Scaling Group.
A lifecycle hook tells Auto Scaling that you want to perform an action on an instance that is not actively in service; for example, either when the instance launches or before the instance terminates.
This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:
For more information, see Auto Scaling Lifecycle Hooks in the Auto Scaling User Guide .
If you exceed your maximum limit of lifecycle hooks, which by default is 50 per Auto Scaling group, the call fails. For information about updating this limit, see AWS Service Limits in the Amazon Web Services General Reference .
See also: AWS API Documentation
Request Syntax
response = client.put_lifecycle_hook(
LifecycleHookName='string',
AutoScalingGroupName='string',
LifecycleTransition='string',
RoleARN='string',
NotificationTargetARN='string',
NotificationMetadata='string',
HeartbeatTimeout=123,
DefaultResult='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
This example creates a lifecycle hook.
response = client.put_lifecycle_hook(
AutoScalingGroupName='my-auto-scaling-group',
LifecycleHookName='my-lifecycle-hook',
LifecycleTransition='autoscaling:EC2_INSTANCE_LAUNCHING',
NotificationTargetARN='arn:aws:sns:us-west-2:123456789012:my-sns-topic --role-arn',
RoleARN='arn:aws:iam::123456789012:role/my-auto-scaling-role',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
put_notification_configuration(**kwargs)¶Configures an Auto Scaling group to send notifications when specified events take place. Subscribers to the specified topic can have messages delivered to an endpoint such as a web server or an email address.
This configuration overwrites any existing configuration.
For more information see Getting SNS Notifications When Your Auto Scaling Group Scales in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.put_notification_configuration(
AutoScalingGroupName='string',
TopicARN='string',
NotificationTypes=[
'string',
]
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example adds the specified notification to the specified Auto Scaling group.
response = client.put_notification_configuration(
AutoScalingGroupName='my-auto-scaling-group',
NotificationTypes=[
'autoscaling:TEST_NOTIFICATION',
],
TopicARN='arn:aws:sns:us-west-2:123456789012:my-sns-topic',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
put_scaling_policy(**kwargs)¶Creates or updates a policy for an Auto Scaling group. To update an existing policy, use the existing policy name and set the parameters you want to change. Any existing parameter not changed in an update to an existing policy is not changed in this update request.
If you exceed your maximum limit of step adjustments, which by default is 20 per region, the call fails. For information about updating this limit, see AWS Service Limits in the Amazon Web Services General Reference .
See also: AWS API Documentation
Request Syntax
response = client.put_scaling_policy(
AutoScalingGroupName='string',
PolicyName='string',
PolicyType='string',
AdjustmentType='string',
MinAdjustmentStep=123,
MinAdjustmentMagnitude=123,
ScalingAdjustment=123,
Cooldown=123,
MetricAggregationType='string',
StepAdjustments=[
{
'MetricIntervalLowerBound': 123.0,
'MetricIntervalUpperBound': 123.0,
'ScalingAdjustment': 123
},
],
EstimatedInstanceWarmup=123,
TargetTrackingConfiguration={
'PredefinedMetricSpecification': {
'PredefinedMetricType': 'ASGAverageCPUUtilization'|'ASGAverageNetworkIn'|'ASGAverageNetworkOut'|'ALBRequestCountPerTarget',
'ResourceLabel': 'string'
},
'CustomizedMetricSpecification': {
'MetricName': 'string',
'Namespace': 'string',
'Dimensions': [
{
'Name': 'string',
'Value': 'string'
},
],
'Statistic': 'Average'|'Minimum'|'Maximum'|'SampleCount'|'Sum',
'Unit': 'string'
},
'TargetValue': 123.0,
'DisableScaleIn': True|False
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'PolicyARN': 'string',
'Alarms': [
{
'AlarmName': 'string',
'AlarmARN': 'string'
},
]
}
Response Structure
|
Examples
This example adds the specified policy to the specified Auto Scaling group.
response = client.put_scaling_policy(
AdjustmentType='ChangeInCapacity',
AutoScalingGroupName='my-auto-scaling-group',
PolicyName='ScaleIn',
ScalingAdjustment=-1,
)
print(response)
Expected Output:
{
'PolicyARN': 'arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2233f3d7-6290-403b-b632-93c553560106:autoScalingGroupName/my-auto-scaling-group:policyName/ScaleIn',
'ResponseMetadata': {
'...': '...',
},
}
put_scheduled_update_group_action(**kwargs)¶Creates or updates a scheduled scaling action for an Auto Scaling group. When updating a scheduled scaling action, if you leave a parameter unspecified, the corresponding value remains unchanged.
For more information, see Scheduled Scaling in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.put_scheduled_update_group_action(
AutoScalingGroupName='string',
ScheduledActionName='string',
Time=datetime(2015, 1, 1),
StartTime=datetime(2015, 1, 1),
EndTime=datetime(2015, 1, 1),
Recurrence='string',
MinSize=123,
MaxSize=123,
DesiredCapacity=123
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example adds the specified scheduled action to the specified Auto Scaling group.
response = client.put_scheduled_update_group_action(
AutoScalingGroupName='my-auto-scaling-group',
DesiredCapacity=4,
EndTime=datetime(2014, 5, 12, 8, 0, 0, 0, 132, 0),
MaxSize=6,
MinSize=2,
ScheduledActionName='my-scheduled-action',
StartTime=datetime(2014, 5, 12, 8, 0, 0, 0, 132, 0),
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
record_lifecycle_action_heartbeat(**kwargs)¶Records a heartbeat for the lifecycle action associated with the specified token or instance. This extends the timeout by the length of time defined using PutLifecycleHook .
This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:
For more information, see Auto Scaling Lifecycle in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.record_lifecycle_action_heartbeat(
LifecycleHookName='string',
AutoScalingGroupName='string',
LifecycleActionToken='string',
InstanceId='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
This example records a lifecycle action heartbeat to keep the instance in a pending state.
response = client.record_lifecycle_action_heartbeat(
AutoScalingGroupName='my-auto-scaling-group',
LifecycleActionToken='bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635',
LifecycleHookName='my-lifecycle-hook',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
resume_processes(**kwargs)¶Resumes the specified suspended Auto Scaling processes, or all suspended process, for the specified Auto Scaling group.
For more information, see Suspending and Resuming Auto Scaling Processes in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.resume_processes(
AutoScalingGroupName='string',
ScalingProcesses=[
'string',
]
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example resumes the specified suspended scaling process for the specified Auto Scaling group.
response = client.resume_processes(
AutoScalingGroupName='my-auto-scaling-group',
ScalingProcesses=[
'AlarmNotification',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
set_desired_capacity(**kwargs)¶Sets the size of the specified Auto Scaling group.
For more information about desired capacity, see What Is Auto Scaling? in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.set_desired_capacity(
AutoScalingGroupName='string',
DesiredCapacity=123,
HonorCooldown=True|False
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example sets the desired capacity for the specified Auto Scaling group.
response = client.set_desired_capacity(
AutoScalingGroupName='my-auto-scaling-group',
DesiredCapacity=2,
HonorCooldown=True,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
set_instance_health(**kwargs)¶Sets the health status of the specified instance.
For more information, see Health Checks in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.set_instance_health(
InstanceId='string',
HealthStatus='string',
ShouldRespectGracePeriod=True|False
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example sets the health status of the specified instance to Unhealthy.
response = client.set_instance_health(
HealthStatus='Unhealthy',
InstanceId='i-93633f9b',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
set_instance_protection(**kwargs)¶Updates the instance protection settings of the specified instances.
For more information, see Instance Protection in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.set_instance_protection(
InstanceIds=[
'string',
],
AutoScalingGroupName='string',
ProtectedFromScaleIn=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
Examples
This example enables instance protection for the specified instance.
response = client.set_instance_protection(
AutoScalingGroupName='my-auto-scaling-group',
InstanceIds=[
'i-93633f9b',
],
ProtectedFromScaleIn=True,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example disables instance protection for the specified instance.
response = client.set_instance_protection(
AutoScalingGroupName='my-auto-scaling-group',
InstanceIds=[
'i-93633f9b',
],
ProtectedFromScaleIn=False,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
suspend_processes(**kwargs)¶Suspends the specified Auto Scaling processes, or all processes, for the specified Auto Scaling group.
Note that if you suspend either the Launch or Terminate process types, it can prevent other process types from functioning properly.
To resume processes that have been suspended, use ResumeProcesses .
For more information, see Suspending and Resuming Auto Scaling Processes in the Auto Scaling User Guide .
See also: AWS API Documentation
Request Syntax
response = client.suspend_processes(
AutoScalingGroupName='string',
ScalingProcesses=[
'string',
]
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example suspends the specified scaling process for the specified Auto Scaling group.
response = client.suspend_processes(
AutoScalingGroupName='my-auto-scaling-group',
ScalingProcesses=[
'AlarmNotification',
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
terminate_instance_in_auto_scaling_group(**kwargs)¶Terminates the specified instance and optionally adjusts the desired group size.
This call simply makes a termination request. The instance is not terminated immediately.
See also: AWS API Documentation
Request Syntax
response = client.terminate_instance_in_auto_scaling_group(
InstanceId='string',
ShouldDecrementDesiredCapacity=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Activity': {
'ActivityId': 'string',
'AutoScalingGroupName': 'string',
'Description': 'string',
'Cause': 'string',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'StatusCode': 'PendingSpotBidPlacement'|'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
}
}
Response Structure
|
Examples
This example terminates the specified instance from the specified Auto Scaling group without updating the size of the group. Auto Scaling launches a replacement instance after the specified instance terminates.
response = client.terminate_instance_in_auto_scaling_group(
InstanceId='i-93633f9b',
ShouldDecrementDesiredCapacity=False,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
update_auto_scaling_group(**kwargs)¶Updates the configuration for the specified Auto Scaling group.
To update an Auto Scaling group with a launch configuration with InstanceMonitoring set to False , you must first disable the collection of group metrics. Otherwise, you will get an error. If you have previously enabled the collection of group metrics, you can disable it using DisableMetricsCollection .
The new settings are registered upon the completion of this call. Any launch configuration settings take effect on any triggers after this call returns. Scaling activities that are currently in progress aren’t affected.
Note the following:
MinSize without specifying a value for DesiredCapacity , and the new MinSize is larger than the current size of the group, we implicitly call SetDesiredCapacity to set the size of the group to the new value of MinSize .MaxSize without specifying a value for DesiredCapacity , and the new MaxSize is smaller than the current size of the group, we implicitly call SetDesiredCapacity to set the size of the group to the new value of MaxSize .See also: AWS API Documentation
Request Syntax
response = client.update_auto_scaling_group(
AutoScalingGroupName='string',
LaunchConfigurationName='string',
MinSize=123,
MaxSize=123,
DesiredCapacity=123,
DefaultCooldown=123,
AvailabilityZones=[
'string',
],
HealthCheckType='string',
HealthCheckGracePeriod=123,
PlacementGroup='string',
VPCZoneIdentifier='string',
TerminationPolicies=[
'string',
],
NewInstancesProtectedFromScaleIn=True|False
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
This example updates the launch configuration of the specified Auto Scaling group.
response = client.update_auto_scaling_group(
AutoScalingGroupName='my-auto-scaling-group',
LaunchConfigurationName='new-launch-config',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example updates the minimum size and maximum size of the specified Auto Scaling group.
response = client.update_auto_scaling_group(
AutoScalingGroupName='my-auto-scaling-group',
MaxSize=3,
MinSize=1,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
This example enables instance protection for the specified Auto Scaling group.
response = client.update_auto_scaling_group(
AutoScalingGroupName='my-auto-scaling-group',
NewInstancesProtectedFromScaleIn=True,
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
The available paginators are:
AutoScaling.Paginator.DescribeAutoScalingGroupsAutoScaling.Paginator.DescribeAutoScalingInstancesAutoScaling.Paginator.DescribeLaunchConfigurationsAutoScaling.Paginator.DescribeNotificationConfigurationsAutoScaling.Paginator.DescribePoliciesAutoScaling.Paginator.DescribeScalingActivitiesAutoScaling.Paginator.DescribeScheduledActionsAutoScaling.Paginator.DescribeTagsAutoScaling.Paginator.DescribeAutoScalingGroups¶paginator = client.get_paginator('describe_auto_scaling_groups')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_auto_scaling_groups().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
AutoScalingGroupNames=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AutoScalingGroups': [
{
'AutoScalingGroupName': 'string',
'AutoScalingGroupARN': 'string',
'LaunchConfigurationName': 'string',
'MinSize': 123,
'MaxSize': 123,
'DesiredCapacity': 123,
'DefaultCooldown': 123,
'AvailabilityZones': [
'string',
],
'LoadBalancerNames': [
'string',
],
'TargetGroupARNs': [
'string',
],
'HealthCheckType': 'string',
'HealthCheckGracePeriod': 123,
'Instances': [
{
'InstanceId': 'string',
'AvailabilityZone': 'string',
'LifecycleState': 'Pending'|'Pending:Wait'|'Pending:Proceed'|'Quarantined'|'InService'|'Terminating'|'Terminating:Wait'|'Terminating:Proceed'|'Terminated'|'Detaching'|'Detached'|'EnteringStandby'|'Standby',
'HealthStatus': 'string',
'LaunchConfigurationName': 'string',
'ProtectedFromScaleIn': True|False
},
],
'CreatedTime': datetime(2015, 1, 1),
'SuspendedProcesses': [
{
'ProcessName': 'string',
'SuspensionReason': 'string'
},
],
'PlacementGroup': 'string',
'VPCZoneIdentifier': 'string',
'EnabledMetrics': [
{
'Metric': 'string',
'Granularity': 'string'
},
],
'Status': 'string',
'Tags': [
{
'ResourceId': 'string',
'ResourceType': 'string',
'Key': 'string',
'Value': 'string',
'PropagateAtLaunch': True|False
},
],
'TerminationPolicies': [
'string',
],
'NewInstancesProtectedFromScaleIn': True|False
},
],
}
Response Structure
|
AutoScaling.Paginator.DescribeAutoScalingInstances¶paginator = client.get_paginator('describe_auto_scaling_instances')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_auto_scaling_instances().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
InstanceIds=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'AutoScalingInstances': [
{
'InstanceId': 'string',
'AutoScalingGroupName': 'string',
'AvailabilityZone': 'string',
'LifecycleState': 'string',
'HealthStatus': 'string',
'LaunchConfigurationName': 'string',
'ProtectedFromScaleIn': True|False
},
],
}
Response Structure
|
AutoScaling.Paginator.DescribeLaunchConfigurations¶paginator = client.get_paginator('describe_launch_configurations')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_launch_configurations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
LaunchConfigurationNames=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'LaunchConfigurations': [
{
'LaunchConfigurationName': 'string',
'LaunchConfigurationARN': 'string',
'ImageId': 'string',
'KeyName': 'string',
'SecurityGroups': [
'string',
],
'ClassicLinkVPCId': 'string',
'ClassicLinkVPCSecurityGroups': [
'string',
],
'UserData': 'string',
'InstanceType': 'string',
'KernelId': 'string',
'RamdiskId': 'string',
'BlockDeviceMappings': [
{
'VirtualName': 'string',
'DeviceName': 'string',
'Ebs': {
'SnapshotId': 'string',
'VolumeSize': 123,
'VolumeType': 'string',
'DeleteOnTermination': True|False,
'Iops': 123,
'Encrypted': True|False
},
'NoDevice': True|False
},
],
'InstanceMonitoring': {
'Enabled': True|False
},
'SpotPrice': 'string',
'IamInstanceProfile': 'string',
'CreatedTime': datetime(2015, 1, 1),
'EbsOptimized': True|False,
'AssociatePublicIpAddress': True|False,
'PlacementTenancy': 'string'
},
],
}
Response Structure
|
AutoScaling.Paginator.DescribeNotificationConfigurations¶paginator = client.get_paginator('describe_notification_configurations')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_notification_configurations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
AutoScalingGroupNames=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'NotificationConfigurations': [
{
'AutoScalingGroupName': 'string',
'TopicARN': 'string',
'NotificationType': 'string'
},
],
}
Response Structure
|
AutoScaling.Paginator.DescribePolicies¶paginator = client.get_paginator('describe_policies')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_policies().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
AutoScalingGroupName='string',
PolicyNames=[
'string',
],
PolicyTypes=[
'string',
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ScalingPolicies': [
{
'AutoScalingGroupName': 'string',
'PolicyName': 'string',
'PolicyARN': 'string',
'PolicyType': 'string',
'AdjustmentType': 'string',
'MinAdjustmentStep': 123,
'MinAdjustmentMagnitude': 123,
'ScalingAdjustment': 123,
'Cooldown': 123,
'StepAdjustments': [
{
'MetricIntervalLowerBound': 123.0,
'MetricIntervalUpperBound': 123.0,
'ScalingAdjustment': 123
},
],
'MetricAggregationType': 'string',
'EstimatedInstanceWarmup': 123,
'Alarms': [
{
'AlarmName': 'string',
'AlarmARN': 'string'
},
],
'TargetTrackingConfiguration': {
'PredefinedMetricSpecification': {
'PredefinedMetricType': 'ASGAverageCPUUtilization'|'ASGAverageNetworkIn'|'ASGAverageNetworkOut'|'ALBRequestCountPerTarget',
'ResourceLabel': 'string'
},
'CustomizedMetricSpecification': {
'MetricName': 'string',
'Namespace': 'string',
'Dimensions': [
{
'Name': 'string',
'Value': 'string'
},
],
'Statistic': 'Average'|'Minimum'|'Maximum'|'SampleCount'|'Sum',
'Unit': 'string'
},
'TargetValue': 123.0,
'DisableScaleIn': True|False
}
},
],
}
Response Structure
|
AutoScaling.Paginator.DescribeScalingActivities¶paginator = client.get_paginator('describe_scaling_activities')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_scaling_activities().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ActivityIds=[
'string',
],
AutoScalingGroupName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Activities': [
{
'ActivityId': 'string',
'AutoScalingGroupName': 'string',
'Description': 'string',
'Cause': 'string',
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'StatusCode': 'PendingSpotBidPlacement'|'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
},
],
}
Response Structure
|
AutoScaling.Paginator.DescribeScheduledActions¶paginator = client.get_paginator('describe_scheduled_actions')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_scheduled_actions().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
AutoScalingGroupName='string',
ScheduledActionNames=[
'string',
],
StartTime=datetime(2015, 1, 1),
EndTime=datetime(2015, 1, 1),
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'ScheduledUpdateGroupActions': [
{
'AutoScalingGroupName': 'string',
'ScheduledActionName': 'string',
'ScheduledActionARN': 'string',
'Time': datetime(2015, 1, 1),
'StartTime': datetime(2015, 1, 1),
'EndTime': datetime(2015, 1, 1),
'Recurrence': 'string',
'MinSize': 123,
'MaxSize': 123,
'DesiredCapacity': 123
},
],
}
Response Structure
|
AutoScaling.Paginator.DescribeTags¶paginator = client.get_paginator('describe_tags')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_tags().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'string',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'Tags': [
{
'ResourceId': 'string',
'ResourceType': 'string',
'Key': 'string',
'Value': 'string',
'PropagateAtLaunch': True|False
},
],
}
Response Structure
|