Table of Contents
AutoScaling.
Client
¶A low-level client representing Auto Scaling:
import boto3
client = boto3.client('autoscaling')
These are the available methods:
attach_instances()
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_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_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()
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.
For more information, see Attach EC2 Instances to Your Auto Scaling Group in the Auto Scaling Developer Guide .
Request Syntax
response = client.attach_instances(
InstanceIds=[
'string',
],
AutoScalingGroupName='string'
)
Parameters: |
|
---|---|
Returns: | None |
attach_load_balancers
(**kwargs)¶Attaches one or more load balancers to the specified Auto Scaling group.
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 Developer Guide .
Request Syntax
response = client.attach_load_balancers(
AutoScalingGroupName='string',
LoadBalancerNames=[
'string',
]
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {}
Response Structure
|
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 associated token initiated under the given lifecycle hook with the specified result.
This operation is a part of the basic sequence for adding a lifecycle hook to an Auto Scaling group:
For more information, see Auto Scaling Pending State and Auto Scaling Terminating State in the Auto Scaling Developer Guide .
Request Syntax
response = client.complete_lifecycle_action(
LifecycleHookName='string',
AutoScalingGroupName='string',
LifecycleActionToken='string',
LifecycleActionResult='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {}
Response Structure
|
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 Developer Guide .
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',
],
HealthCheckType='string',
HealthCheckGracePeriod=123,
PlacementGroup='string',
VPCZoneIdentifier='string',
TerminationPolicies=[
'string',
],
Tags=[
{
'ResourceId': 'string',
'ResourceType': 'string',
'Key': 'string',
'Value': 'string',
'PropagateAtLaunch': True|False
},
]
)
Parameters: |
|
---|---|
Returns: | None |
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 Developer Guide .
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
},
'NoDevice': True|False
},
],
InstanceMonitoring={
'Enabled': True|False
},
SpotPrice='string',
IamInstanceProfile='string',
EbsOptimized=True|False,
AssociatePublicIpAddress=True|False,
PlacementTenancy='string'
)
Parameters: |
|
---|---|
Returns: | None |
Creates or updates tags for the specified Auto Scaling group.
A tag is defined by its resource ID, resource type, key, value, and propagate flag. The value and the propagate flag are optional parameters. The only supported resource type is auto-scaling-group
, and the resource ID must be the name of the group. The PropagateAtLaunch
flag determines whether the tag is added to instances launched in the group. Valid values are true
or false
.
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 Developer Guide .
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 |
delete_auto_scaling_group
(**kwargs)¶Deletes the specified Auto Scaling group.
The group must have no instances and no scaling activities in progress.
To remove all instances before calling DeleteAutoScalingGroup
, call UpdateAutoScalingGroup to set the minimum and maximum size of the Auto Scaling group to zero.
Request Syntax
response = client.delete_auto_scaling_group(
AutoScalingGroupName='string',
ForceDelete=True|False
)
Parameters: |
|
---|---|
Returns: | None |
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.
Request Syntax
response = client.delete_launch_configuration(
LaunchConfigurationName='string'
)
Parameters: | LaunchConfigurationName (string) -- [REQUIRED] The name of the launch configuration. |
---|---|
Returns: | None |
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).
Request Syntax
response = client.delete_lifecycle_hook(
LifecycleHookName='string',
AutoScalingGroupName='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {}
Response Structure
|
delete_notification_configuration
(**kwargs)¶Deletes the specified notification.
Request Syntax
response = client.delete_notification_configuration(
AutoScalingGroupName='string',
TopicARN='string'
)
Parameters: |
|
---|---|
Returns: | None |
delete_policy
(**kwargs)¶Deletes the specified Auto Scaling policy.
Request Syntax
response = client.delete_policy(
AutoScalingGroupName='string',
PolicyName='string'
)
Parameters: |
|
---|---|
Returns: | None |
delete_scheduled_action
(**kwargs)¶Deletes the specified scheduled action.
Request Syntax
response = client.delete_scheduled_action(
AutoScalingGroupName='string',
ScheduledActionName='string'
)
Parameters: |
|
---|---|
Returns: | None |
Deletes the specified tags.
Request Syntax
response = client.delete_tags(
Tags=[
{
'ResourceId': 'string',
'ResourceType': 'string',
'Key': 'string',
'Value': 'string',
'PropagateAtLaunch': True|False
},
]
)
Parameters: | Tags (list) -- [REQUIRED] Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. Valid values are: Resource type = auto-scaling-group , Resource ID = AutoScalingGroupName , key=*value* , value=*value* , propagate=*true* or false .
|
---|---|
Returns: | None |
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 .
Request Syntax
response = client.describe_account_limits()
Return type: | dict |
---|---|
Returns: | Response Syntax{
'MaxNumberOfAutoScalingGroups': 123,
'MaxNumberOfLaunchConfigurations': 123
}
Response Structure
|
describe_adjustment_types
()¶Describes the policy adjustment types for use with PutScalingPolicy .
Request Syntax
response = client.describe_adjustment_types()
Return type: | dict |
---|---|
Returns: | Response Syntax{
'AdjustmentTypes': [
{
'AdjustmentType': 'string'
},
]
}
Response Structure
|
describe_auto_scaling_groups
(**kwargs)¶Describes one or more Auto Scaling groups. If a list of names is not provided, the call describes all Auto Scaling groups.
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',
],
'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'
},
],
'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',
]
},
],
'NextToken': 'string'
}
Response Structure
|
describe_auto_scaling_instances
(**kwargs)¶Describes one or more Auto Scaling instances. If a list is not provided, the call describes all instances.
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'
},
],
'NextToken': 'string'
}
Response Structure
|
describe_auto_scaling_notification_types
()¶Describes the notification types that are supported by Auto Scaling.
Request Syntax
response = client.describe_auto_scaling_notification_types()
Return type: | dict |
---|---|
Returns: | Response Syntax{
'AutoScalingNotificationTypes': [
'string',
]
}
Response Structure
|
describe_launch_configurations
(**kwargs)¶Describes one or more launch configurations. If you omit the list of names, then the call describes all launch configurations.
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
},
'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
|
describe_lifecycle_hook_types
()¶Describes the available types of lifecycle hooks.
Request Syntax
response = client.describe_lifecycle_hook_types()
Return type: | dict |
---|---|
Returns: | Response Syntax{
'LifecycleHookTypes': [
'string',
]
}
Response Structure
|
describe_lifecycle_hooks
(**kwargs)¶Describes the lifecycle hooks for the specified Auto Scaling group.
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
|
describe_load_balancers
(**kwargs)¶Describes the load balancers for the specified Auto Scaling group.
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
|
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 .
Request Syntax
response = client.describe_metric_collection_types()
Return type: | dict |
---|---|
Returns: | Response Syntax{
'Metrics': [
{
'Metric': 'string'
},
],
'Granularities': [
{
'Granularity': 'string'
},
]
}
Response Structure
|
describe_notification_configurations
(**kwargs)¶Describes the notification actions associated with the specified Auto Scaling group.
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
|
describe_policies
(**kwargs)¶Describes the policies for the specified Auto Scaling group.
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'
},
]
},
],
'NextToken': 'string'
}
Response Structure
|
describe_scaling_activities
(**kwargs)¶Describes one or more scaling activities for the specified Auto Scaling group. If you omit the ActivityIds
, the call returns all activities from the past six weeks. Activities are sorted by the start time. Activities still in progress appear first on the list.
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': 'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
describe_scaling_process_types
()¶Describes the scaling process types for use with ResumeProcesses and SuspendProcesses .
Request Syntax
response = client.describe_scaling_process_types()
Return type: | dict |
---|---|
Returns: | Response Syntax{
'Processes': [
{
'ProcessName': 'string'
},
]
}
Response Structure
|
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 .
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
|
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.
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
|
describe_termination_policy_types
()¶Describes the termination policies supported by Auto Scaling.
Request Syntax
response = client.describe_termination_policy_types()
Return type: | dict |
---|---|
Returns: | Response Syntax{
'TerminationPolicyTypes': [
'string',
]
}
Response Structure
|
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.
For more information, see Detach EC2 Instances from Your Auto Scaling Group in the Auto Scaling Developer Guide .
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': 'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
},
]
}
Response Structure
|
detach_load_balancers
(**kwargs)¶Removes one or more load balancers from the specified Auto Scaling group.
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.
Request Syntax
response = client.detach_load_balancers(
AutoScalingGroupName='string',
LoadBalancerNames=[
'string',
]
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {}
Response Structure
|
disable_metrics_collection
(**kwargs)¶Disables monitoring of the specified metrics for the specified Auto Scaling group.
Request Syntax
response = client.disable_metrics_collection(
AutoScalingGroupName='string',
Metrics=[
'string',
]
)
Parameters: |
|
---|---|
Returns: | None |
enable_metrics_collection
(**kwargs)¶Enables monitoring of the specified metrics for the specified Auto Scaling group.
You can only enable metrics collection if InstanceMonitoring
in the launch configuration for the group is set to True
.
Request Syntax
response = client.enable_metrics_collection(
AutoScalingGroupName='string',
Metrics=[
'string',
],
Granularity='string'
)
Parameters: |
|
---|---|
Returns: | None |
enter_standby
(**kwargs)¶Moves the specified instances into Standby
mode.
For more information, see Auto Scaling InService State in the Auto Scaling Developer Guide .
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': 'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
},
]
}
Response Structure
|
execute_policy
(**kwargs)¶Executes the specified policy.
Request Syntax
response = client.execute_policy(
AutoScalingGroupName='string',
PolicyName='string',
HonorCooldown=True|False,
MetricValue=123.0,
BreachThreshold=123.0
)
Parameters: |
|
---|---|
Returns: | None |
exit_standby
(**kwargs)¶Moves the specified instances out of Standby
mode.
For more information, see Auto Scaling InService State in the Auto Scaling Developer Guide .
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': 'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
},
]
}
Response Structure
|
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 operation is a part of the basic sequence for adding a lifecycle hook to an Auto Scaling group:
For more information, see Auto Scaling Pending State and Auto Scaling Terminating State in the Auto Scaling Developer Guide .
If you exceed your maximum limit of lifecycle hooks, which by default is 50 per region, the call fails. For information about updating this limit, see AWS Service Limits in the Amazon Web Services General Reference .
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
|
put_notification_configuration
(**kwargs)¶Configures an Auto Scaling group to send notifications when specified events take place. Subscribers to this topic can have messages for events delivered to an endpoint such as a web server or email address.
For more information see Getting Notifications When Your Auto Scaling Group Changes in the Auto Scaling Developer Guide .
This configuration overwrites an existing configuration.
Request Syntax
response = client.put_notification_configuration(
AutoScalingGroupName='string',
TopicARN='string',
NotificationTypes=[
'string',
]
)
Parameters: |
|
---|---|
Returns: | None |
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 .
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
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {
'PolicyARN': 'string'
}
Response Structure
|
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 in the affected Auto Scaling group.
For more information, see Scheduled Scaling in the Auto Scaling Developer Guide .
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 |
record_lifecycle_action_heartbeat
(**kwargs)¶Records a heartbeat for the lifecycle action associated with a specific token. This extends the timeout by the length of time defined by the HeartbeatTimeout
parameter of PutLifecycleHook .
This operation is a part of the basic sequence for adding a lifecycle hook to an Auto Scaling group:
For more information, see Auto Scaling Pending State and Auto Scaling Terminating State in the Auto Scaling Developer Guide .
Request Syntax
response = client.record_lifecycle_action_heartbeat(
LifecycleHookName='string',
AutoScalingGroupName='string',
LifecycleActionToken='string'
)
Parameters: |
|
---|---|
Return type: | dict |
Returns: | Response Syntax {}
Response Structure
|
resume_processes
(**kwargs)¶Resumes the specified suspended Auto Scaling processes for the specified Auto Scaling group. To resume specific processes, use the ScalingProcesses
parameter. To resume all processes, omit the ScalingProcesses
parameter. For more information, see Suspend and Resume Auto Scaling Processes in the Auto Scaling Developer Guide .
Request Syntax
response = client.resume_processes(
AutoScalingGroupName='string',
ScalingProcesses=[
'string',
]
)
Parameters: |
|
---|---|
Returns: | None |
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 Developer Guide .
Request Syntax
response = client.set_desired_capacity(
AutoScalingGroupName='string',
DesiredCapacity=123,
HonorCooldown=True|False
)
Parameters: |
|
---|---|
Returns: | None |
set_instance_health
(**kwargs)¶Sets the health status of the specified instance.
For more information, see Health Checks in the Auto Scaling Developer Guide .
Request Syntax
response = client.set_instance_health(
InstanceId='string',
HealthStatus='string',
ShouldRespectGracePeriod=True|False
)
Parameters: |
|
---|---|
Returns: | None |
suspend_processes
(**kwargs)¶Suspends the specified Auto Scaling processes for the specified Auto Scaling group. To suspend specific processes, use the ScalingProcesses
parameter. To suspend all processes, omit the ScalingProcesses
parameter.
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 Suspend and Resume Auto Scaling Processes in the Auto Scaling Developer Guide .
Request Syntax
response = client.suspend_processes(
AutoScalingGroupName='string',
ScalingProcesses=[
'string',
]
)
Parameters: |
|
---|---|
Returns: | None |
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 instances is not terminated immediately.
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': 'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
}
}
Response Structure
|
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
.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',
]
)
Parameters: |
|
---|---|
Returns: | None |
The available paginators are:
AutoScaling.Paginator.describe_auto_scaling_groups
AutoScaling.Paginator.describe_auto_scaling_instances
AutoScaling.Paginator.describe_launch_configurations
AutoScaling.Paginator.describe_notification_configurations
AutoScaling.Paginator.describe_policies
AutoScaling.Paginator.describe_scaling_activities
AutoScaling.Paginator.describe_scheduled_actions
AutoScaling.Paginator.describe_tags
AutoScaling.Paginator.
describe_auto_scaling_groups
¶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()
.
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',
],
'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'
},
],
'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',
]
},
],
}
Response Structure
|
AutoScaling.Paginator.
describe_auto_scaling_instances
¶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()
.
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'
},
],
}
Response Structure
|
AutoScaling.Paginator.
describe_launch_configurations
¶paginator = client.get_paginator('describe_launch_configurations')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_launch_configurations()
.
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
},
'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.
describe_notification_configurations
¶paginator = client.get_paginator('describe_notification_configurations')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_notification_configurations()
.
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.
describe_policies
¶paginator = client.get_paginator('describe_policies')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_policies()
.
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'
},
]
},
],
}
Response Structure
|
AutoScaling.Paginator.
describe_scaling_activities
¶paginator = client.get_paginator('describe_scaling_activities')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_scaling_activities()
.
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': 'WaitingForSpotInstanceRequestId'|'WaitingForSpotInstanceId'|'WaitingForInstanceId'|'PreInService'|'InProgress'|'WaitingForELBConnectionDraining'|'MidLifecycleAction'|'WaitingForInstanceWarmup'|'Successful'|'Failed'|'Cancelled',
'StatusMessage': 'string',
'Progress': 123,
'Details': 'string'
},
],
}
Response Structure
|
AutoScaling.Paginator.
describe_scheduled_actions
¶paginator = client.get_paginator('describe_scheduled_actions')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from AutoScaling.Client.describe_scheduled_actions()
.
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
|
paginator = client.get_paginator('describe_tags')
Creates an iterator that will paginate through responses from AutoScaling.Client.describe_tags()
.
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
|