Auto Scaling

2015/05/07 - Auto Scaling - 45 new api methods

DescribeAccountLimits (new) Link ¶

Describes the current Auto Scaling resource limits for your AWS account.

For information about requesting an increase in these limits, see AWS Service Limits.

Request Syntax

client.describe_account_limits()
rtype:

dict

returns:

Response Syntax

{
    'MaxNumberOfAutoScalingGroups': 123,
    'MaxNumberOfLaunchConfigurations': 123
}

Response Structure

  • (dict) --

    • MaxNumberOfAutoScalingGroups (integer) --

      The maximum number of groups allowed for your AWS account. The default limit is 20 per region.

    • MaxNumberOfLaunchConfigurations (integer) --

      The maximum number of launch configurations allowed for your AWS account. The default limit is 100 per region.

EnableMetricsCollection (new) Link ¶

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

client.enable_metrics_collection(
    AutoScalingGroupName='string',
    Metrics=[
        'string',
    ],
    Granularity='string'
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name or ARN of the Auto Scaling group.

type Metrics:

list

param Metrics:

One or more of the following metrics:

  • GroupMinSize

  • GroupMaxSize

  • GroupDesiredCapacity

  • GroupInServiceInstances

  • GroupPendingInstances

  • GroupStandbyInstances

  • GroupTerminatingInstances

  • GroupTotalInstances

If you omit this parameter, all metrics are enabled.

  • (string) --

type Granularity:

string

param Granularity:

[REQUIRED]

The granularity to associate with the metrics to collect. Currently, the only valid value is "1Minute".

returns:

None

PutNotificationConfiguration (new) Link ¶

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

client.put_notification_configuration(
    AutoScalingGroupName='string',
    TopicARN='string',
    NotificationTypes=[
        'string',
    ]
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the Auto Scaling group.

type TopicARN:

string

param TopicARN:

[REQUIRED]

The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic.

type NotificationTypes:

list

param NotificationTypes:

[REQUIRED]

The type of event that will cause the notification to be sent. For details about notification types supported by Auto Scaling, see DescribeAutoScalingNotificationTypes.

  • (string) --

returns:

None

DeleteNotificationConfiguration (new) Link ¶

Deletes the specified notification.

Request Syntax

client.delete_notification_configuration(
    AutoScalingGroupName='string',
    TopicARN='string'
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the Auto Scaling group.

type TopicARN:

string

param TopicARN:

[REQUIRED]

The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic.

returns:

None

ExitStandby (new) Link ¶

Moves the specified instances out of Standby mode.

For more information, see Auto Scaling InService State in the Auto Scaling Developer Guide.

Request Syntax

client.exit_standby(
    InstanceIds=[
        'string',
    ],
    AutoScalingGroupName='string'
)
type InstanceIds:

list

param InstanceIds:

One or more instance IDs. You must specify at least one instance ID.

  • (string) --

type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the Auto Scaling group.

rtype:

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'|'Successful'|'Failed'|'Cancelled',
            'StatusMessage': 'string',
            'Progress': 123,
            'Details': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Activities (list) --

      The activities related to moving instances out of Standby mode.

      • (dict) --

        Describes a long-running process that represents a change to your Auto Scaling group, such as changing its size. This can also be a process to replace an instance, or a process to perform any other long-running operations.

        • ActivityId (string) --

          The ID of the activity.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group.

        • Description (string) --

          A friendly, more verbose description of the scaling activity.

        • Cause (string) --

          The reason the activity was begun.

        • StartTime (datetime) --

          The start time of this activity.

        • EndTime (datetime) --

          The end time of this activity.

        • StatusCode (string) --

          The current status of the activity.

        • StatusMessage (string) --

          A friendly, more verbose description of the activity status.

        • Progress (integer) --

          A value between 0 and 100 that indicates the progress of the activity.

        • Details (string) --

          The details about the scaling activity.

DescribeTerminationPolicyTypes (new) Link ¶

Lists the termination policies supported by Auto Scaling.

Request Syntax

client.describe_termination_policy_types()
rtype:

dict

returns:

Response Syntax

{
    'TerminationPolicyTypes': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • TerminationPolicyTypes (list) --

      The Termination policies supported by Auto Scaling. They are: OldestInstance, OldestLaunchConfiguration, NewestInstance, ClosestToNextInstanceHour, and Default.

      • (string) --

ExecutePolicy (new) Link ¶

Executes the specified policy.

Request Syntax

client.execute_policy(
    AutoScalingGroupName='string',
    PolicyName='string',
    HonorCooldown=True|False
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

The name or Amazon Resource Name (ARN) of the Auto Scaling group.

type PolicyName:

string

param PolicyName:

[REQUIRED]

The name or ARN of the policy.

type HonorCooldown:

boolean

param HonorCooldown:

Set to True if you want Auto Scaling to wait for the cooldown period associated with the Auto Scaling group to complete before executing the policy.

Set to False if you want Auto Scaling to circumvent the cooldown period associated with the Auto Scaling group and execute the policy before the cooldown period ends.

For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

returns:

None

DetachInstances (new) Link ¶

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

client.detach_instances(
    InstanceIds=[
        'string',
    ],
    AutoScalingGroupName='string',
    ShouldDecrementDesiredCapacity=True|False
)
type InstanceIds:

list

param InstanceIds:

One or more instance IDs.

  • (string) --

type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the group.

type ShouldDecrementDesiredCapacity:

boolean

param ShouldDecrementDesiredCapacity:

[REQUIRED]

If True, the Auto Scaling group decrements the desired capacity value by the number of instances detached.

rtype:

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'|'Successful'|'Failed'|'Cancelled',
            'StatusMessage': 'string',
            'Progress': 123,
            'Details': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Activities (list) --

      The activities related to detaching the instances from the Auto Scaling group.

      • (dict) --

        Describes a long-running process that represents a change to your Auto Scaling group, such as changing its size. This can also be a process to replace an instance, or a process to perform any other long-running operations.

        • ActivityId (string) --

          The ID of the activity.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group.

        • Description (string) --

          A friendly, more verbose description of the scaling activity.

        • Cause (string) --

          The reason the activity was begun.

        • StartTime (datetime) --

          The start time of this activity.

        • EndTime (datetime) --

          The end time of this activity.

        • StatusCode (string) --

          The current status of the activity.

        • StatusMessage (string) --

          A friendly, more verbose description of the activity status.

        • Progress (integer) --

          A value between 0 and 100 that indicates the progress of the activity.

        • Details (string) --

          The details about the scaling activity.

RecordLifecycleActionHeartbeat (new) Link ¶

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:

  • Create a notification target. A target can be either an Amazon SQS queue or an Amazon SNS topic.

  • Create an IAM role. This role allows Auto Scaling to publish lifecycle notifications to the designated SQS queue or SNS topic.

  • Create the lifecycle hook. You can create a hook that acts when instances launch or when instances terminate.

  • If necessary, record the lifecycle action heartbeat to keep the instance in a pending state.

  • Complete the lifecycle action.

For more information, see Auto Scaling Pending State and Auto Scaling Terminating State in the Auto Scaling Developer Guide.

Request Syntax

client.record_lifecycle_action_heartbeat(
    LifecycleHookName='string',
    AutoScalingGroupName='string',
    LifecycleActionToken='string'
)
type LifecycleHookName:

string

param LifecycleHookName:

[REQUIRED]

The name of the lifecycle hook.

type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the Auto Scaling group for the hook.

type LifecycleActionToken:

string

param LifecycleActionToken:

[REQUIRED]

A token that uniquely identifies a specific lifecycle action associated with an instance. Auto Scaling sends this token to the notification target you specified when you created the lifecycle hook.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

UpdateAutoScalingGroup (new) Link ¶

Updates the configuration for the specified AutoScalingGroup.

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.

Request Syntax

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',
    ]
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the Auto Scaling group.

type LaunchConfigurationName:

string

param LaunchConfigurationName:

The name of the launch configuration.

type MinSize:

integer

param MinSize:

The minimum size of the Auto Scaling group.

type MaxSize:

integer

param MaxSize:

The maximum size of the Auto Scaling group.

type DesiredCapacity:

integer

param DesiredCapacity:

The number of EC2 instances that should be running in the Auto Scaling group. This value must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.

type DefaultCooldown:

integer

param DefaultCooldown:

The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. For more information, see Understanding Auto Scaling Cooldowns.

type AvailabilityZones:

list

param AvailabilityZones:

One or more Availability Zones for the group.

  • (string) --

type HealthCheckType:

string

param HealthCheckType:

The type of health check for the instances in the Auto Scaling group. The health check type can either be EC2 for Amazon EC2 or ELB for Elastic Load Balancing.

type HealthCheckGracePeriod:

integer

param HealthCheckGracePeriod:

The amount of time, in second, that Auto Scaling waits before checking the health status of an instance. The grace period begins when the instance passes System Status and the Instance Status checks from Amazon EC2. For more information, see DescribeInstanceStatus.

type PlacementGroup:

string

param PlacementGroup:

The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups.

type VPCZoneIdentifier:

string

param VPCZoneIdentifier:

The subnet identifier for the Amazon VPC connection, if applicable. You can specify several subnets in a comma-separated list.

When you specify VPCZoneIdentifier with AvailabilityZones, ensure that the subnets' Availability Zones match the values you specify for AvailabilityZones.

For more information, see Auto Scaling and Amazon VPC in the Auto Scaling Developer Guide.

type TerminationPolicies:

list

param TerminationPolicies:

A standalone termination policy or a list of termination policies used to select the instance to terminate. The policies are executed in the order that they are listed.

For more information, see Choosing a Termination Policy for Your Auto Scaling Group in the Auto Scaling Developer Guide.

  • (string) --

returns:

None

DescribeScalingActivities (new) Link ¶

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.

You can specify a maximum number of items to be returned with a single call. If there are more items to return, the call returns a token. To get the next set of items, repeat the call with the returned token in the NextToken parameter.

Request Syntax

client.describe_scaling_activities(
    ActivityIds=[
        'string',
    ],
    AutoScalingGroupName='string',
    MaxRecords=123,
    NextToken='string'
)
type ActivityIds:

list

param ActivityIds:

A list containing the activity IDs of the desired scaling activities. If this list is omitted, all activities are described. If an AutoScalingGroupName is provided, the results are limited to that group. The list of requested activities cannot contain more than 50 items. If unknown activities are requested, they are ignored with no error.

  • (string) --

type AutoScalingGroupName:

string

param AutoScalingGroupName:

The name of the group.

type MaxRecords:

integer

param MaxRecords:

The maximum number of items to return with this call.

type NextToken:

string

param NextToken:

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

rtype:

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'|'Successful'|'Failed'|'Cancelled',
            'StatusMessage': 'string',
            'Progress': 123,
            'Details': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Activities (list) --

      The scaling activities.

      • (dict) --

        Describes a long-running process that represents a change to your Auto Scaling group, such as changing its size. This can also be a process to replace an instance, or a process to perform any other long-running operations.

        • ActivityId (string) --

          The ID of the activity.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group.

        • Description (string) --

          A friendly, more verbose description of the scaling activity.

        • Cause (string) --

          The reason the activity was begun.

        • StartTime (datetime) --

          The start time of this activity.

        • EndTime (datetime) --

          The end time of this activity.

        • StatusCode (string) --

          The current status of the activity.

        • StatusMessage (string) --

          A friendly, more verbose description of the activity status.

        • Progress (integer) --

          A value between 0 and 100 that indicates the progress of the activity.

        • Details (string) --

          The details about the scaling activity.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

TerminateInstanceInAutoScalingGroup (new) Link ¶

Terminates the specified instance and optionally adjusts the desired group size.

Request Syntax

client.terminate_instance_in_auto_scaling_group(
    InstanceId='string',
    ShouldDecrementDesiredCapacity=True|False
)
type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the EC2 instance.

type ShouldDecrementDesiredCapacity:

boolean

param ShouldDecrementDesiredCapacity:

[REQUIRED]

If true, terminating this instance also decrements the size of the Auto Scaling group.

rtype:

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'|'Successful'|'Failed'|'Cancelled',
        'StatusMessage': 'string',
        'Progress': 123,
        'Details': 'string'
    }
}

Response Structure

  • (dict) --

    • Activity (dict) --

      A scaling activity.

      • ActivityId (string) --

        The ID of the activity.

      • AutoScalingGroupName (string) --

        The name of the Auto Scaling group.

      • Description (string) --

        A friendly, more verbose description of the scaling activity.

      • Cause (string) --

        The reason the activity was begun.

      • StartTime (datetime) --

        The start time of this activity.

      • EndTime (datetime) --

        The end time of this activity.

      • StatusCode (string) --

        The current status of the activity.

      • StatusMessage (string) --

        A friendly, more verbose description of the activity status.

      • Progress (integer) --

        A value between 0 and 100 that indicates the progress of the activity.

      • Details (string) --

        The details about the scaling activity.

CreateOrUpdateTags (new) Link ¶

Creates or updates tags for the specified Auto Scaling group.

For more information, see Add, Modify, or Remove Auto Scaling Group Tags in the Auto Scaling Developer Guide.

Request Syntax

client.create_or_update_tags(
    Tags=[
        {
            'ResourceId': 'string',
            'ResourceType': 'string',
            'Key': 'string',
            'Value': 'string',
            'PropagateAtLaunch': True|False
        },
    ]
)
type Tags:

list

param Tags:

[REQUIRED]

The tag to be created or updated. Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. The resource type and resource ID identify the type and name of resource for which the tag is created. Currently, auto-scaling-group is the only supported resource type. The valid value for the resource ID is groupname.

The PropagateAtLaunch flag defines whether the new tag will be applied to instances launched by the group. Valid values are true or false. However, instances that are already running will not get the new or updated tag. Likewise, when you modify a tag, the updated version will be applied only to new instances launched by the group after the change. Running instances that had the previous version of the tag will continue to have the older tag.

When you create a tag and a tag of the same name already exists, the operation overwrites the previous tag definition, but you will not get an error message.

  • (dict) --

    Describes a tag applied to an Auto Scaling group.

    • ResourceId (string) --

      The name of the group.

    • ResourceType (string) --

      The kind of resource to which the tag is applied. Currently, Auto Scaling supports the auto-scaling-group resource type.

    • Key (string) -- [REQUIRED]

      The tag key.

    • Value (string) --

      The tag value.

    • PropagateAtLaunch (boolean) --

      Specifies whether the tag is applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, it is applied to all instances launched after you made the change.

returns:

None

DescribeNotificationConfigurations (new) Link ¶

Describes the notification actions associated with the specified Auto Scaling group.

Request Syntax

client.describe_notification_configurations(
    AutoScalingGroupNames=[
        'string',
    ],
    NextToken='string',
    MaxRecords=123
)
type AutoScalingGroupNames:

list

param AutoScalingGroupNames:

The name of the group.

  • (string) --

type NextToken:

string

param NextToken:

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

type MaxRecords:

integer

param MaxRecords:

The maximum number of items to return with this call.

rtype:

dict

returns:

Response Syntax

{
    'NotificationConfigurations': [
        {
            'AutoScalingGroupName': 'string',
            'TopicARN': 'string',
            'NotificationType': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • NotificationConfigurations (list) --

      The notification configurations.

      • (dict) --

        Describes a notification.

        • AutoScalingGroupName (string) --

          The name of the group.

        • TopicARN (string) --

          The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic.

        • NotificationType (string) --

          The types of events for an action to start.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

DescribePolicies (new) Link ¶

Describes the policies for the specified Auto Scaling group.

You can specify a maximum number of items to be returned with a single call. If there are more items to return, the call returns a token. To get the next set of items, repeat the call with the returned token in the NextToken parameter.

Request Syntax

client.describe_policies(
    AutoScalingGroupName='string',
    PolicyNames=[
        'string',
    ],
    NextToken='string',
    MaxRecords=123
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

The name of the group.

type PolicyNames:

list

param PolicyNames:

One or more policy names or policy ARNs to be described. If you omit this list, all policy names are described. If an group name is provided, the results are limited to that group. This list is limited to 50 items. If you specify an unknown policy name, it is ignored with no error.

  • (string) --

type NextToken:

string

param NextToken:

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

type MaxRecords:

integer

param MaxRecords:

The maximum number of items to be returned with each call.

rtype:

dict

returns:

Response Syntax

{
    'ScalingPolicies': [
        {
            'AutoScalingGroupName': 'string',
            'PolicyName': 'string',
            'ScalingAdjustment': 123,
            'AdjustmentType': 'string',
            'Cooldown': 123,
            'PolicyARN': 'string',
            'Alarms': [
                {
                    'AlarmName': 'string',
                    'AlarmARN': 'string'
                },
            ],
            'MinAdjustmentStep': 123
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ScalingPolicies (list) --

      The scaling policies.

      • (dict) --

        Describes a scaling policy.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group associated with this scaling policy.

        • PolicyName (string) --

          The name of the scaling policy.

        • ScalingAdjustment (integer) --

          The number associated with the specified adjustment type. A positive value adds to the current capacity and a negative value removes from the current capacity.

        • AdjustmentType (string) --

          Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

        • Cooldown (integer) --

          The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.

        • PolicyARN (string) --

          The Amazon Resource Name (ARN) of the policy.

        • Alarms (list) --

          The CloudWatch Alarms related to the policy.

          • (dict) --

            Describes an alarm.

            • AlarmName (string) --

              The name of the alarm.

            • AlarmARN (string) --

              The Amazon Resource Name (ARN) of the alarm.

        • MinAdjustmentStep (integer) --

          Changes the DesiredCapacity of the Auto Scaling group by at least the specified number of instances.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

ResumeProcesses (new) Link ¶

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

client.resume_processes(
    AutoScalingGroupName='string',
    ScalingProcesses=[
        'string',
    ]
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name or Amazon Resource Name (ARN) of the Auto Scaling group.

type ScalingProcesses:

list

param ScalingProcesses:

One or more of the following processes:

  • Launch

  • Terminate

  • HealthCheck

  • ReplaceUnhealthy

  • AZRebalance

  • AlarmNotification

  • ScheduledActions

  • AddToLoadBalancer

  • (string) --

returns:

None

DescribeAdjustmentTypes (new) Link ¶

Lists the policy adjustment types for use with PutScalingPolicy.

Request Syntax

client.describe_adjustment_types()
rtype:

dict

returns:

Response Syntax

{
    'AdjustmentTypes': [
        {
            'AdjustmentType': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • AdjustmentTypes (list) --

      The policy adjustment types.

      • (dict) --

        Describes a policy adjustment type.

        • AdjustmentType (string) --

          The policy adjustment type. The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

          For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.

DescribeTags (new) Link ¶

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

client.describe_tags(
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    NextToken='string',
    MaxRecords=123
)
type Filters:

list

param Filters:

The value of the filter type used to identify the tags to be returned. For example, you can filter so that tags are returned according to Auto Scaling group, the key and value, or whether the new tag will be applied to instances launched after the tag is created (PropagateAtLaunch).

  • (dict) --

    Describes a filter.

    • Name (string) --

      The name of the filter. The valid values are: "auto-scaling-group", "key", "value", and "propagate-at-launch".

    • Values (list) --

      The value of the filter.

      • (string) --

type NextToken:

string

param NextToken:

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

type MaxRecords:

integer

param MaxRecords:

The maximum number of items to return with this call.

rtype:

dict

returns:

Response Syntax

{
    'Tags': [
        {
            'ResourceId': 'string',
            'ResourceType': 'string',
            'Key': 'string',
            'Value': 'string',
            'PropagateAtLaunch': True|False
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Tags (list) --

      The tags.

      • (dict) --

        Describes a tag applied to an Auto Scaling group.

        • ResourceId (string) --

          The name of the group.

        • ResourceType (string) --

          The kind of resource to which the tag is applied. Currently, Auto Scaling supports the auto-scaling-group resource type.

        • Key (string) --

          The tag key.

        • Value (string) --

          The tag value.

        • PropagateAtLaunch (boolean) --

          Specifies whether the tag is applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, it is applied to all instances launched after you made the change.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

AttachInstances (new) Link ¶

Attaches one or more EC2 instances to the specified Auto Scaling group.

For more information, see Attach Amazon EC2 Instances to Your Existing Auto Scaling Group in the Auto Scaling Developer Guide.

Request Syntax

client.attach_instances(
    InstanceIds=[
        'string',
    ],
    AutoScalingGroupName='string'
)
type InstanceIds:

list

param InstanceIds:

One or more EC2 instance IDs. You must specify at least one ID.

  • (string) --

type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the group.

returns:

None

PutScalingPolicy (new) Link ¶

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.

Request Syntax

client.put_scaling_policy(
    AutoScalingGroupName='string',
    PolicyName='string',
    ScalingAdjustment=123,
    AdjustmentType='string',
    Cooldown=123,
    MinAdjustmentStep=123
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name or ARN of the group.

type PolicyName:

string

param PolicyName:

[REQUIRED]

The name of the policy.

type ScalingAdjustment:

integer

param ScalingAdjustment:

[REQUIRED]

The number of instances by which to scale. AdjustmentType determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.

type AdjustmentType:

string

param AdjustmentType:

[REQUIRED]

Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity. Valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity.

For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.

type Cooldown:

integer

param Cooldown:

The amount of time, in seconds, after a scaling activity completes and before the next scaling activity can start.

For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

type MinAdjustmentStep:

integer

param MinAdjustmentStep:

Used with AdjustmentType with the value PercentChangeInCapacity, the scaling policy changes the DesiredCapacity of the Auto Scaling group by at least the number of instances specified in the value.

You will get a ValidationError if you use MinAdjustmentStep on a policy with an AdjustmentType other than PercentChangeInCapacity.

rtype:

dict

returns:

Response Syntax

{
    'PolicyARN': 'string'
}

Response Structure

  • (dict) --

    • PolicyARN (string) --

      The Amazon Resource Name (ARN) of the policy.

DeleteAutoScalingGroup (new) Link ¶

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, you can call UpdateAutoScalingGroup to set the minimum and maximum size of the AutoScalingGroup to zero.

Request Syntax

client.delete_auto_scaling_group(
    AutoScalingGroupName='string',
    ForceDelete=True|False
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the group to delete.

type ForceDelete:

boolean

param ForceDelete:

Specifies that the group will be deleted along with all instances associated with the group, without waiting for all instances to be terminated. This parameter also deletes any lifecycle actions associated with the group.

returns:

None

DeleteScheduledAction (new) Link ¶

Deletes the specified scheduled action.

Request Syntax

client.delete_scheduled_action(
    AutoScalingGroupName='string',
    ScheduledActionName='string'
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

The name of the Auto Scaling group.

type ScheduledActionName:

string

param ScheduledActionName:

[REQUIRED]

The name of the action to delete.

returns:

None

SuspendProcesses (new) Link ¶

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

client.suspend_processes(
    AutoScalingGroupName='string',
    ScalingProcesses=[
        'string',
    ]
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name or Amazon Resource Name (ARN) of the Auto Scaling group.

type ScalingProcesses:

list

param ScalingProcesses:

One or more of the following processes:

  • Launch

  • Terminate

  • HealthCheck

  • ReplaceUnhealthy

  • AZRebalance

  • AlarmNotification

  • ScheduledActions

  • AddToLoadBalancer

  • (string) --

returns:

None

CreateAutoScalingGroup (new) Link ¶

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 these limits, see DescribeAccountLimits.

Request Syntax

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
        },
    ]
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the group. This name must be unique within the scope of your AWS account.

type LaunchConfigurationName:

string

param LaunchConfigurationName:

The name of the launch configuration. Alternatively, use the InstanceId parameter to specify an EC2 instance instead of a launch configuration.

type InstanceId:

string

param InstanceId:

The ID of the EC2 instance used to create a launch configuration for the group. Alternatively, use the LaunchConfigurationName parameter to specify a launch configuration instead of an EC2 instance.

When you specify an ID of an instance, Auto Scaling creates a new launch configuration and associates it with the group. This launch configuration derives its attributes from the specified instance, with the exception of the block device mapping.

For more information, see Create an Auto Scaling Group Using an EC2 Instance ID in the Auto Scaling Developer Guide.

type MinSize:

integer

param MinSize:

[REQUIRED]

The minimum size of the group.

type MaxSize:

integer

param MaxSize:

[REQUIRED]

The maximum size of the group.

type DesiredCapacity:

integer

param DesiredCapacity:

The number of EC2 instances that should be running in the group. This value must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group.

type DefaultCooldown:

integer

param DefaultCooldown:

The amount of time, in seconds, after a scaling activity completes before another scaling activity can start.

If DefaultCooldown is not specified, the default value is 300. For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.

type AvailabilityZones:

list

param AvailabilityZones:

One or more Availability Zones for the group. This parameter is optional if you specify subnets using the VPCZoneIdentifier parameter.

  • (string) --

type LoadBalancerNames:

list

param LoadBalancerNames:

One or more load balancers.

For more information, see Load Balance Your Auto Scaling Group in the Auto Scaling Developer Guide.

  • (string) --

type HealthCheckType:

string

param HealthCheckType:

The service to use for the health checks. The valid values are EC2 and ELB.

By default, health checks use Amazon EC2 instance status checks to determine the health of an instance. For more information, see Health Checks.

type HealthCheckGracePeriod:

integer

param HealthCheckGracePeriod:

The amount of time, in seconds, after an EC2 instance comes into service that Auto Scaling starts checking its health. During this time, any health check failures for the instance are ignored.

This parameter is required if you are adding an ELB health check. Frequently, new instances need to warm up, briefly, before they can pass a health check. To provide ample warm-up time, set the health check grace period of the group to match the expected startup period of your application.

For more information, see Add an Elastic Load Balancing Health Check to Your Auto Scaling Group in the Auto Scaling Developer Guide.

type PlacementGroup:

string

param PlacementGroup:

The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups.

type VPCZoneIdentifier:

string

param VPCZoneIdentifier:

A comma-separated list of subnet identifiers for your virtual private cloud (VPC).

If you specify subnets and Availability Zones with this call, ensure that the subnets' Availability Zones match the Availability Zones specified.

For more information, see Auto Scaling and Amazon VPC in the Auto Scaling Developer Guide.

type TerminationPolicies:

list

param TerminationPolicies:

One or more termination policies used to select the instance to terminate. These policies are executed in the order that they are listed.

For more information, see Choosing a Termination Policy for Your Auto Scaling Group in the Auto Scaling Developer Guide.

  • (string) --

type Tags:

list

param Tags:

The tag to be created or updated. Each tag should be defined by its resource type, resource ID, key, value, and a propagate flag. Valid values: key=*value*, value=*value*, propagate=*true* or false. Value and propagate are optional parameters.

For more information, see Add, Modify, or Remove Auto Scaling Group Tags in the Auto Scaling Developer Guide.

  • (dict) --

    Describes a tag applied to an Auto Scaling group.

    • ResourceId (string) --

      The name of the group.

    • ResourceType (string) --

      The kind of resource to which the tag is applied. Currently, Auto Scaling supports the auto-scaling-group resource type.

    • Key (string) -- [REQUIRED]

      The tag key.

    • Value (string) --

      The tag value.

    • PropagateAtLaunch (boolean) --

      Specifies whether the tag is applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, it is applied to all instances launched after you made the change.

returns:

None

DescribeScheduledActions (new) Link ¶

Lists the actions scheduled for your Auto Scaling group that haven't been executed. To list the actions that were already executed, use DescribeScalingActivities.

Request Syntax

client.describe_scheduled_actions(
    AutoScalingGroupName='string',
    ScheduledActionNames=[
        'string',
    ],
    StartTime=datetime(2015, 1, 1),
    EndTime=datetime(2015, 1, 1),
    NextToken='string',
    MaxRecords=123
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

The name of the group.

type ScheduledActionNames:

list

param ScheduledActionNames:

Describes one or more scheduled actions. If you omit this list, the call describes all scheduled actions. If you specify an unknown scheduled action it is ignored with no error.

You can describe up to a maximum of 50 instances with a single call. If there are more items to return, the call returns a token. To get the next set of items, repeat the call with the returned token in the NextToken parameter.

  • (string) --

type StartTime:

datetime

param StartTime:

The earliest scheduled start time to return. If scheduled action names are provided, this parameter is ignored.

type EndTime:

datetime

param EndTime:

The latest scheduled start time to return. If scheduled action names are provided, this parameter is ignored.

type NextToken:

string

param NextToken:

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

type MaxRecords:

integer

param MaxRecords:

The maximum number of items to return with this call.

rtype:

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

  • (dict) --

    • ScheduledUpdateGroupActions (list) --

      The scheduled actions.

      • (dict) --

        Describes a scheduled update to an Auto Scaling group.

        • AutoScalingGroupName (string) --

          The name of the group.

        • ScheduledActionName (string) --

          The name of the scheduled action.

        • ScheduledActionARN (string) --

          The Amazon Resource Name (ARN) of the scheduled action.

        • Time (datetime) --

          Time is deprecated.

          The time that the action is scheduled to begin. Time is an alias for StartTime.

        • StartTime (datetime) --

          The time that the action is scheduled to begin. This value can be up to one month in the future.

          When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action will start and stop.

        • EndTime (datetime) --

          The time that the action is scheduled to end. This value can be up to one month in the future.

        • Recurrence (string) --

          The regular schedule that an action occurs.

        • MinSize (integer) --

          The minimum size of the group.

        • MaxSize (integer) --

          The maximum size of the group.

        • DesiredCapacity (integer) --

          The number of instances you prefer to maintain in the group.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

DescribeLaunchConfigurations (new) Link ¶

Describes one or more launch configurations. If you omit the list of names, then the call describes all launch configurations.

You can specify a maximum number of items to be returned with a single call. If there are more items to return, the call returns a token. To get the next set of items, repeat the call with the returned token in the NextToken parameter.

Request Syntax

client.describe_launch_configurations(
    LaunchConfigurationNames=[
        'string',
    ],
    NextToken='string',
    MaxRecords=123
)
type LaunchConfigurationNames:

list

param LaunchConfigurationNames:

The launch configuration names.

  • (string) --

type NextToken:

string

param NextToken:

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

type MaxRecords:

integer

param MaxRecords:

The maximum number of items to return with this call. The default is 100.

rtype:

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

  • (dict) --

    • LaunchConfigurations (list) --

      The launch configurations.

      • (dict) --

        Describes a launch configuration.

        • LaunchConfigurationName (string) --

          The name of the launch configuration.

        • LaunchConfigurationARN (string) --

          The Amazon Resource Name (ARN) of the launch configuration.

        • ImageId (string) --

          The ID of the Amazon Machine Image (AMI).

        • KeyName (string) --

          The name of the key pair.

        • SecurityGroups (list) --

          The security groups to associate with the EC2 instances.

          • (string) --

        • ClassicLinkVPCId (string) --

          The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. This parameter can only be used if you are launching EC2-Classic instances. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.

        • ClassicLinkVPCSecurityGroups (list) --

          The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId. This parameter is required if ClassicLinkVPCId is specified, and cannot be used otherwise. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.

          • (string) --

        • UserData (string) --

          The user data available to the EC2 instances.

        • InstanceType (string) --

          The instance type for the EC2 instances.

        • KernelId (string) --

          The ID of the kernel associated with the AMI.

        • RamdiskId (string) --

          The ID of the RAM disk associated with the AMI.

        • BlockDeviceMappings (list) --

          A block device mapping that specifies how block devices are exposed to the instance. Each mapping is made up of a virtualName and a deviceName.

          • (dict) --

            Describes a block device mapping.

            • VirtualName (string) --

              The name of the virtual device, ephemeral0 to ephemeral3.

            • DeviceName (string) --

              The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh).

            • Ebs (dict) --

              The information about the Amazon EBS volume.

              • SnapshotId (string) --

                The ID of the snapshot.

              • VolumeSize (integer) --

                The volume size, in gigabytes.

                Valid values: If the volume type is io1, the minimum size of the volume is 10 GiB. If you specify SnapshotId and VolumeSize, VolumeSize must be equal to or larger than the size of the snapshot.

                Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the size of the snapshot.

                Required: Required when the volume type is io1.

              • VolumeType (string) --

                The volume type.

                Valid values: standard | io1 | gp2

                Default: standard

              • DeleteOnTermination (boolean) --

                Indicates whether to delete the volume on instance termination.

                Default: true

              • Iops (integer) --

                For Provisioned IOPS (SSD) volumes only. The number of I/O operations per second (IOPS) to provision for the volume.

                Valid values: Range is 100 to 4000.

                Default: None

            • NoDevice (boolean) --

              Suppresses a device mapping.

        • InstanceMonitoring (dict) --

          Controls whether instances in this group are launched with detailed monitoring.

          • Enabled (boolean) --

            If True, instance monitoring is enabled.

        • SpotPrice (string) --

          The price to bid when launching Spot Instances.

        • IamInstanceProfile (string) --

          The name or Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.

        • CreatedTime (datetime) --

          The creation date and time for the launch configuration.

        • EbsOptimized (boolean) --

          Controls whether the instance is optimized for EBS I/O ( true) or not ( false).

        • AssociatePublicIpAddress (boolean) --

          Specifies whether the EC2 instances are associated with a public IP address ( true) or not ( false).

        • PlacementTenancy (string) --

          The tenancy of the instance, either default or dedicated. An instance with dedicated tenancy runs in an isolated, single-tenant hardware and can only be launched in a VPC.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

DescribeScalingProcessTypes (new) Link ¶

Returns scaling process types for use in the ResumeProcesses and SuspendProcesses actions.

Request Syntax

client.describe_scaling_process_types()
rtype:

dict

returns:

Response Syntax

{
    'Processes': [
        {
            'ProcessName': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Processes (list) --

      The names of the process types.

      • (dict) --

        Describes a process type.

        There are two primary Auto Scaling process types-- Launch and Terminate. The Launch process creates a new EC2 instance for an Auto Scaling group, and the Terminate process removes an existing EC2 instance. The remaining Auto Scaling process types relate to specific Auto Scaling features:

        • AddToLoadBalancer

        • AlarmNotification

        • AZRebalance

        • HealthCheck

        • ReplaceUnhealthy

        • ScheduledActions

        The AddToLoadBalancer process type adds instances to the load balancer when the instances are launched. If you suspend this process, Auto Scaling will launch the instances but will not add them to the load balancer. If you resume the AddToLoadBalancer process, Auto Scaling will also resume adding new instances to the load balancer when they are launched. However, Auto Scaling will not add running instances that were launched while the process was suspended; those instances must be added manually using the RegisterInstancesWithLoadBalancer call.

        The AlarmNotification process type accepts notifications from Amazon CloudWatch alarms that are associated with the Auto Scaling group. If you suspend the AlarmNotification process type, Auto Scaling will not automatically execute scaling policies that would be triggered by alarms.

        Although the AlarmNotification process type is not directly affected by a suspension of Launch or Terminate, alarm notifications are often used to signal that a change in the size of the Auto Scaling group is warranted. If you suspend Launch or Terminate, Auto Scaling might not be able to implement the alarm's associated policy.

        The AZRebalance process type seeks to maintain a balanced number of instances across Availability Zones within a Region. If you remove an Availability Zone from your Auto Scaling group or an Availability Zone otherwise becomes unhealthy or unavailable, Auto Scaling launches new instances in an unaffected Availability Zone before terminating the unhealthy or unavailable instances. When the unhealthy Availability Zone returns to a healthy state, Auto Scaling automatically redistributes the application instances evenly across all of the designated Availability Zones.

        The HealthCheck process type checks the health of the instances. Auto Scaling marks an instance as unhealthy if Amazon EC2 or Elastic Load Balancing informs Auto Scaling that the instance is unhealthy. The HealthCheck process can override the health status of an instance that you set with SetInstanceHealth.

        The ReplaceUnhealthy process type terminates instances that are marked as unhealthy and subsequently creates new instances to replace them. This process calls both of the primary process types--first Terminate and then Launch.

        The ScheduledActions process type performs scheduled actions that you create with PutScheduledUpdateGroupAction. Scheduled actions often involve launching new instances or terminating existing instances. If you suspend either Launch or Terminate, your scheduled actions might not function as expected.

        • ProcessName (string) --

          The name of the process.

PutScheduledUpdateGroupAction (new) Link ¶

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

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
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name or Amazon Resource Name (ARN) of the Auto Scaling group.

type ScheduledActionName:

string

param ScheduledActionName:

[REQUIRED]

The name of this scaling action.

type Time:

datetime

param Time:

Time is deprecated.

The time for this action to start. Time is an alias for StartTime and can be specified instead of StartTime, or vice versa. If both Time and StartTime are specified, their values should be identical. Otherwise, PutScheduledUpdateGroupAction will return an error.

type StartTime:

datetime

param StartTime:

The time for this action to start, as in --start-time 2010-06-01T00:00:00Z.

If you try to schedule your action in the past, Auto Scaling returns an error message.

When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action will start and stop.

type EndTime:

datetime

param EndTime:

The time for this action to end.

type Recurrence:

string

param Recurrence:

The time when recurring future actions will start. Start time is specified by the user following the Unix cron syntax format. For information about cron syntax, go to Wikipedia, The Free Encyclopedia.

When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action will start and stop.

type MinSize:

integer

param MinSize:

The minimum size for the new Auto Scaling group.

type MaxSize:

integer

param MaxSize:

The maximum size for the Auto Scaling group.

type DesiredCapacity:

integer

param DesiredCapacity:

The number of Amazon EC2 instances that should be running in the group.

returns:

None

DeletePolicy (new) Link ¶

Deletes the specified Auto Scaling policy.

Request Syntax

client.delete_policy(
    AutoScalingGroupName='string',
    PolicyName='string'
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

The name of the Auto Scaling group.

type PolicyName:

string

param PolicyName:

[REQUIRED]

The name or Amazon Resource Name (ARN) of the policy.

returns:

None

DescribeAutoScalingInstances (new) Link ¶

Describes one or more Auto Scaling instances. If a list is not provided, the call describes all instances.

You can describe up to a maximum of 50 instances with a single call. By default, a call returns up to 20 instances. If there are more items to return, the call returns a token. To get the next set of items, repeat the call with the returned token in the NextToken parameter.

Request Syntax

client.describe_auto_scaling_instances(
    InstanceIds=[
        'string',
    ],
    MaxRecords=123,
    NextToken='string'
)
type InstanceIds:

list

param InstanceIds:

One or more Auto Scaling instances to describe, up to 50 instances. If you omit this parameter, all Auto Scaling instances are described. If you specify an ID that does not exist, it is ignored with no error.

  • (string) --

type MaxRecords:

integer

param MaxRecords:

The maximum number of items to return with this call.

type NextToken:

string

param NextToken:

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

rtype:

dict

returns:

Response Syntax

{
    'AutoScalingInstances': [
        {
            'InstanceId': 'string',
            'AutoScalingGroupName': 'string',
            'AvailabilityZone': 'string',
            'LifecycleState': 'string',
            'HealthStatus': 'string',
            'LaunchConfigurationName': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • AutoScalingInstances (list) --

      The instances.

      • (dict) --

        Describes an EC2 instance associated with an Auto Scaling group.

        • InstanceId (string) --

          The ID of the instance.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group associated with the instance.

        • AvailabilityZone (string) --

          The Availability Zone for the instance.

        • LifecycleState (string) --

          The lifecycle state for the instance. For more information, see Auto Scaling Instance States in the Auto Scaling Developer Guide.

        • HealthStatus (string) --

          The health status of this instance. "Healthy" means that the instance is healthy and should remain in service. "Unhealthy" means that the instance is unhealthy and Auto Scaling should terminate and replace it.

        • LaunchConfigurationName (string) --

          The launch configuration associated with the instance.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

EnterStandby (new) Link ¶

Moves the specified instances into Standby mode.

For more information, see Auto Scaling InService State in the Auto Scaling Developer Guide.

Request Syntax

client.enter_standby(
    InstanceIds=[
        'string',
    ],
    AutoScalingGroupName='string',
    ShouldDecrementDesiredCapacity=True|False
)
type InstanceIds:

list

param InstanceIds:

One or more instances to move into Standby mode. You must specify at least one instance ID.

  • (string) --

type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the Auto Scaling group.

type ShouldDecrementDesiredCapacity:

boolean

param ShouldDecrementDesiredCapacity:

[REQUIRED]

Specifies whether the instances moved to Standby mode count as part of the Auto Scaling group's desired capacity. If set, the desired capacity for the Auto Scaling group decrements by the number of instances moved to Standby mode.

rtype:

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'|'Successful'|'Failed'|'Cancelled',
            'StatusMessage': 'string',
            'Progress': 123,
            'Details': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Activities (list) --

      The activities related to moving instances into Standby mode.

      • (dict) --

        Describes a long-running process that represents a change to your Auto Scaling group, such as changing its size. This can also be a process to replace an instance, or a process to perform any other long-running operations.

        • ActivityId (string) --

          The ID of the activity.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group.

        • Description (string) --

          A friendly, more verbose description of the scaling activity.

        • Cause (string) --

          The reason the activity was begun.

        • StartTime (datetime) --

          The start time of this activity.

        • EndTime (datetime) --

          The end time of this activity.

        • StatusCode (string) --

          The current status of the activity.

        • StatusMessage (string) --

          A friendly, more verbose description of the activity status.

        • Progress (integer) --

          A value between 0 and 100 that indicates the progress of the activity.

        • Details (string) --

          The details about the scaling activity.

CompleteLifecycleAction (new) Link ¶

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:

  • Create a notification target. A target can be either an Amazon SQS queue or an Amazon SNS topic.

  • Create an IAM role. This role allows Auto Scaling to publish lifecycle notifications to the designated SQS queue or SNS topic.

  • Create the lifecycle hook. You can create a hook that acts when instances launch or when instances terminate.

  • If necessary, record the lifecycle action heartbeat to keep the instance in a pending state.

  • Complete the lifecycle action.

For more information, see Auto Scaling Pending State and Auto Scaling Terminating State in the Auto Scaling Developer Guide.

Request Syntax

client.complete_lifecycle_action(
    LifecycleHookName='string',
    AutoScalingGroupName='string',
    LifecycleActionToken='string',
    LifecycleActionResult='string'
)
type LifecycleHookName:

string

param LifecycleHookName:

[REQUIRED]

The name of the lifecycle hook.

type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the group for the lifecycle hook.

type LifecycleActionToken:

string

param LifecycleActionToken:

[REQUIRED]

A universally unique identifier (UUID) that identifies a specific lifecycle action associated with an instance. Auto Scaling sends this token to the notification target you specified when you created the lifecycle hook.

type LifecycleActionResult:

string

param LifecycleActionResult:

[REQUIRED]

The action for the group to take. This parameter can be either CONTINUE or ABANDON.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

DescribeLifecycleHooks (new) Link ¶

Describes the lifecycle hooks for the specified Auto Scaling group.

Request Syntax

client.describe_lifecycle_hooks(
    AutoScalingGroupName='string',
    LifecycleHookNames=[
        'string',
    ]
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the group.

type LifecycleHookNames:

list

param LifecycleHookNames:

The names of one or more lifecycle hooks.

  • (string) --

rtype:

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

  • (dict) --

    • LifecycleHooks (list) --

      The lifecycle hooks for the specified group.

      • (dict) --

        Describes a lifecycle hook, which tells Auto Scaling that you want to perform an action when an instance launches or terminates. When you have a lifecycle hook in place, the Auto Scaling group will either:

        • Pause the instance after it launches, but before it is put into service

        • Pause the instance as it terminates, but before it is fully terminated

        For more information, see Auto Scaling Pending State and Auto Scaling Terminating State in the Auto Scaling Developer Guide.

        • LifecycleHookName (string) --

          The name of the lifecycle hook.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group for the lifecycle hook.

        • LifecycleTransition (string) --

          The state of the EC2 instance to which you want to attach the lifecycle hook. For a list of lifecycle hook types, see DescribeLifecycleHooks.

        • NotificationTargetARN (string) --

          The ARN of the notification target that Auto Scaling uses to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic. The notification message sent to the target includes the following:

          • Lifecycle action token

          • User account ID

          • Name of the Auto Scaling group

          • Lifecycle hook name

          • EC2 instance ID

          • Lifecycle transition

          • Notification metadata

        • RoleARN (string) --

          The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.

        • NotificationMetadata (string) --

          Additional information that you want to include any time Auto Scaling sends a message to the notification target.

        • HeartbeatTimeout (integer) --

          The amount of time that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the DefaultResult parameter. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat.

        • GlobalTimeout (integer) --

          The maximum length of time an instance can remain in a Pending:Wait or Terminating:Wait state. Currently, this value is set at 48 hours.

        • DefaultResult (string) --

          Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The valid values are CONTINUE and ABANDON. The default value is CONTINUE.

CreateLaunchConfiguration (new) Link ¶

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 these limits, see DescribeAccountLimits.

Request Syntax

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'
)
type LaunchConfigurationName:

string

param LaunchConfigurationName:

[REQUIRED]

The name of the launch configuration. This name must be unique within the scope of your AWS account.

type ImageId:

string

param ImageId:

The ID of the Amazon Machine Image (AMI) to use to launch your EC2 instances. For more information, see Finding an AMI in the Amazon Elastic Compute Cloud User Guide.

type KeyName:

string

param KeyName:

The name of the key pair. For more information, see Amazon EC2 Key Pairs in the Amazon Elastic Compute Cloud User Guide.

type SecurityGroups:

list

param SecurityGroups:

One or more security groups with which to associate the instances.

If your instances are launched in EC2-Classic, you can either specify security group names or the security group IDs. For more information about security groups for EC2-Classic, see Amazon EC2 Security Groups in the Amazon Elastic Compute Cloud User Guide.

If your instances are launched in a VPC, specify security group IDs. For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide.

  • (string) --

type ClassicLinkVPCId:

string

param ClassicLinkVPCId:

The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. This parameter can only be used if you are launching EC2-Classic instances. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.

type ClassicLinkVPCSecurityGroups:

list

param ClassicLinkVPCSecurityGroups:

The IDs of one or more security groups for the VPC specified in ClassicLinkVPCId. This parameter is required if ClassicLinkVPCId is specified, and cannot be used otherwise. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.

  • (string) --

type UserData:

string

param UserData:

The user data to make available to the launched EC2 instances. For more information, see Instance Metadata and User Data in the Amazon Elastic Compute Cloud User Guide.

type InstanceId:

string

param InstanceId:

The ID of the EC2 instance to use to create the launch configuration.

The new launch configuration derives attributes from the instance, with the exception of the block device mapping.

To create a launch configuration with a block device mapping or override any other instance attributes, specify them as part of the same request.

For more information, see Create a Launch Configuration Using an EC2 Instance in the Auto Scaling Developer Guide.

type InstanceType:

string

param InstanceType:

The instance type of the Amazon EC2 instance. For information about available Amazon EC2 instance types, see Available Instance Types in the Amazon Elastic Cloud Compute User Guide.

type KernelId:

string

param KernelId:

The ID of the kernel associated with the Amazon EC2 AMI.

type RamdiskId:

string

param RamdiskId:

The ID of the RAM disk associated with the Amazon EC2 AMI.

type BlockDeviceMappings:

list

param BlockDeviceMappings:

One or more mappings that specify how block devices are exposed to the instance. For more information, see Block Device Mapping in the Amazon Elastic Compute Cloud User Guide.

  • (dict) --

    Describes a block device mapping.

    • VirtualName (string) --

      The name of the virtual device, ephemeral0 to ephemeral3.

    • DeviceName (string) -- [REQUIRED]

      The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh).

    • Ebs (dict) --

      The information about the Amazon EBS volume.

      • SnapshotId (string) --

        The ID of the snapshot.

      • VolumeSize (integer) --

        The volume size, in gigabytes.

        Valid values: If the volume type is io1, the minimum size of the volume is 10 GiB. If you specify SnapshotId and VolumeSize, VolumeSize must be equal to or larger than the size of the snapshot.

        Default: If you create a volume from a snapshot and you don't specify a volume size, the default is the size of the snapshot.

        Required: Required when the volume type is io1.

      • VolumeType (string) --

        The volume type.

        Valid values: standard | io1 | gp2

        Default: standard

      • DeleteOnTermination (boolean) --

        Indicates whether to delete the volume on instance termination.

        Default: true

      • Iops (integer) --

        For Provisioned IOPS (SSD) volumes only. The number of I/O operations per second (IOPS) to provision for the volume.

        Valid values: Range is 100 to 4000.

        Default: None

    • NoDevice (boolean) --

      Suppresses a device mapping.

type InstanceMonitoring:

dict

param InstanceMonitoring:

Enables detailed monitoring if it is disabled. Detailed monitoring is enabled by default.

When detailed monitoring is enabled, Amazon Cloudwatch generates metrics every minute and your account is charged a fee. When you disable detailed monitoring, by specifying False, Cloudwatch generates metrics every 5 minutes. For more information, see Monitor Your Auto Scaling Instances in the Auto Scaling Developer Guide.

  • Enabled (boolean) --

    If True, instance monitoring is enabled.

type SpotPrice:

string

param SpotPrice:

The maximum hourly price to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot market price. For more information, see Launch Spot Instances in Your Auto Scaling Group in the Auto Scaling Developer Guide.

type IamInstanceProfile:

string

param IamInstanceProfile:

The name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance.

Amazon EC2 instances launched with an IAM role will automatically have AWS security credentials available. You can use IAM roles with Auto Scaling to automatically enable applications running on your Amazon EC2 instances to securely access other AWS resources. For more information, see Launch Auto Scaling Instances with an IAM Role in the Auto Scaling Developer Guide.

type EbsOptimized:

boolean

param EbsOptimized:

Indicates whether the instance is optimized for Amazon EBS I/O. By default, the instance is not optimized for EBS I/O. The optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal I/O performance. This optimization is not available with all instance types. Additional usage charges apply. For more information, see Amazon EBS-Optimized Instances in the Amazon Elastic Compute Cloud User Guide.

type AssociatePublicIpAddress:

boolean

param AssociatePublicIpAddress:

Used for groups that launch instances into a virtual private cloud (VPC). Specifies whether to assign a public IP address to each instance. For more information, see Auto Scaling and Amazon VPC in the Auto Scaling Developer Guide.

Default: If the instance is launched into a default subnet, the default is true. If the instance is launched into a nondefault subnet, the default is false. For more information, see Supported Platforms in the Amazon Elastic Compute Cloud User Guide.

type PlacementTenancy:

string

param PlacementTenancy:

The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant hardware and can only be launched in a VPC.

You must set the value of this parameter to dedicated if want to launch Dedicated Instances in a shared tenancy VPC (VPC with instance placement tenancy attribute set to default).

If you specify a value for this parameter, be sure to specify at least one VPC subnet using the VPCZoneIdentifier parameter when you create your group.

For more information, see Auto Scaling and Amazon VPC in the Auto Scaling Developer Guide.

Valid values: default | dedicated

returns:

None

PutLifecycleHook (new) Link ¶

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:

  • Create a notification target. A target can be either an Amazon SQS queue or an Amazon SNS topic.

  • Create an IAM role. This role allows Auto Scaling to publish lifecycle notifications to the designated SQS queue or SNS topic.

  • Create the lifecycle hook. You can create a hook that acts when instances launch or when instances terminate.

  • If necessary, record the lifecycle action heartbeat to keep the instance in a pending state.

  • Complete the lifecycle action.

For more information, see Auto Scaling Pending State and Auto Scaling Terminating State in the Auto Scaling Developer Guide.

Request Syntax

client.put_lifecycle_hook(
    LifecycleHookName='string',
    AutoScalingGroupName='string',
    LifecycleTransition='string',
    RoleARN='string',
    NotificationTargetARN='string',
    NotificationMetadata='string',
    HeartbeatTimeout=123,
    DefaultResult='string'
)
type LifecycleHookName:

string

param LifecycleHookName:

[REQUIRED]

The name of the lifecycle hook.

type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the Auto Scaling group to which you want to assign the lifecycle hook.

type LifecycleTransition:

string

param LifecycleTransition:

The Amazon EC2 instance state to which you want to attach the lifecycle hook. See DescribeLifecycleHookTypes for a list of available lifecycle hook types.

type RoleARN:

string

param RoleARN:

The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.

type NotificationTargetARN:

string

param NotificationTargetARN:

The ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic.

The notification message sent to the target will include:

  • LifecycleActionToken. The Lifecycle action token.

  • AccountId. The user account ID.

  • AutoScalingGroupName. The name of the Auto Scaling group.

  • LifecycleHookName. The lifecycle hook name.

  • EC2InstanceId. The EC2 instance ID.

  • LifecycleTransition. The lifecycle transition.

  • NotificationMetadata. The notification metadata.

This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email key/value pair format when sending notifications to an Amazon SNS topic.

When you call this operation, a test message is sent to the notification target. This test message contains an additional key/value pair: Event:autoscaling:TEST_NOTIFICATION.

type NotificationMetadata:

string

param NotificationMetadata:

Contains additional information that you want to include any time Auto Scaling sends a message to the notification target.

type HeartbeatTimeout:

integer

param HeartbeatTimeout:

Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the DefaultResult parameter. You can prevent the lifecycle hook from timing out by calling RecordLifecycleActionHeartbeat. The default value for this parameter is 3600 seconds (1 hour).

type DefaultResult:

string

param DefaultResult:

Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses or if an unexpected failure occurs. The value for this parameter can be either CONTINUE or ABANDON. The default value for this parameter is ABANDON.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

SetInstanceHealth (new) Link ¶

Sets the health status of the specified instance.

For more information, see Health Checks in the Auto Scaling Developer Guide.

Request Syntax

client.set_instance_health(
    InstanceId='string',
    HealthStatus='string',
    ShouldRespectGracePeriod=True|False
)
type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the EC2 instance.

type HealthStatus:

string

param HealthStatus:

[REQUIRED]

The health status of the instance. Set to Healthy if you want the instance to remain in service. Set to Unhealthy if you want the instance to be out of service. Auto Scaling will terminate and replace the unhealthy instance.

type ShouldRespectGracePeriod:

boolean

param ShouldRespectGracePeriod:

If the Auto Scaling group of the specified instance has a HealthCheckGracePeriod specified for the group, by default, this call will respect the grace period. Set this to False, if you do not want the call to respect the grace period associated with the group.

For more information, see the HealthCheckGracePeriod parameter description for CreateAutoScalingGroup.

returns:

None

DeleteLaunchConfiguration (new) Link ¶

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

client.delete_launch_configuration(
    LaunchConfigurationName='string'
)
type LaunchConfigurationName:

string

param LaunchConfigurationName:

[REQUIRED]

The name of the launch configuration.

returns:

None

DescribeAutoScalingGroups (new) Link ¶

Describes one or more Auto Scaling groups. If a list of names is not provided, the call describes all Auto Scaling groups.

You can specify a maximum number of items to be returned with a single call. If there are more items to return, the call returns a token. To get the next set of items, repeat the call with the returned token in the NextToken parameter.

Request Syntax

client.describe_auto_scaling_groups(
    AutoScalingGroupNames=[
        'string',
    ],
    NextToken='string',
    MaxRecords=123
)
type AutoScalingGroupNames:

list

param AutoScalingGroupNames:

The group names.

  • (string) --

type NextToken:

string

param NextToken:

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

type MaxRecords:

integer

param MaxRecords:

The maximum number of items to return with this call.

rtype:

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

  • (dict) --

    • AutoScalingGroups (list) --

      The groups.

      • (dict) --

        Describes an Auto Scaling group.

        • AutoScalingGroupName (string) --

          The name of the group.

        • AutoScalingGroupARN (string) --

          The Amazon Resource Name (ARN) of the group.

        • LaunchConfigurationName (string) --

          The name of the associated launch configuration.

        • MinSize (integer) --

          The minimum size of the group.

        • MaxSize (integer) --

          The maximum size of the group.

        • DesiredCapacity (integer) --

          The size of the group.

        • DefaultCooldown (integer) --

          The number of seconds after a scaling activity completes before any further scaling activities can start.

        • AvailabilityZones (list) --

          One or more Availability Zones for the group.

          • (string) --

        • LoadBalancerNames (list) --

          One or more load balancers associated with the group.

          • (string) --

        • HealthCheckType (string) --

          The service of interest for the health status check, which can be either EC2 for Amazon EC2 or ELB for Elastic Load Balancing.

        • HealthCheckGracePeriod (integer) --

          The amount of time that Auto Scaling waits before checking an instance's health status. The grace period begins when an instance comes into service.

        • Instances (list) --

          The EC2 instances associated with the group.

          • (dict) --

            Describes an EC2 instance.

            • InstanceId (string) --

              The ID of the instance.

            • AvailabilityZone (string) --

              The Availability Zone associated with this instance.

            • LifecycleState (string) --

              A description of the current lifecycle state.

            • HealthStatus (string) --

              The health status of the instance.

            • LaunchConfigurationName (string) --

              The launch configuration associated with the instance.

        • CreatedTime (datetime) --

          The date and time the group was created.

        • SuspendedProcesses (list) --

          The suspended processes associated with the group.

          • (dict) --

            Describes an Auto Scaling process that has been suspended. For more information, see ProcessType.

            • ProcessName (string) --

              The name of the suspended process.

            • SuspensionReason (string) --

              The reason that the process was suspended.

        • PlacementGroup (string) --

          The name of the placement group into which you'll launch your instances, if any. For more information, see Placement Groups.

        • VPCZoneIdentifier (string) --

          One or more subnet IDs, if applicable, separated by commas.

          If you specify VPCZoneIdentifier and AvailabilityZones, ensure that the Availability Zones of the subnets match the values for AvailabilityZones.

        • EnabledMetrics (list) --

          The metrics enabled for this Auto Scaling group.

          • (dict) --

            Describes an enabled metric.

            • Metric (string) --

              The name of the metric.

            • Granularity (string) --

              The granularity of the metric.

        • Status (string) --

          The current state of the Auto Scaling group when a DeleteAutoScalingGroup action is in progress.

        • Tags (list) --

          The tags for the Auto Scaling group.

          • (dict) --

            Describes a tag applied to an Auto Scaling group.

            • ResourceId (string) --

              The name of the group.

            • ResourceType (string) --

              The kind of resource to which the tag is applied. Currently, Auto Scaling supports the auto-scaling-group resource type.

            • Key (string) --

              The tag key.

            • Value (string) --

              The tag value.

            • PropagateAtLaunch (boolean) --

              Specifies whether the tag is applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, it is applied to all instances launched after you made the change.

        • TerminationPolicies (list) --

          The termination policies for this Auto Scaling group.

          • (string) --

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

SetDesiredCapacity (new) Link ¶

Sets the size of the specified AutoScalingGroup.

Request Syntax

client.set_desired_capacity(
    AutoScalingGroupName='string',
    DesiredCapacity=123,
    HonorCooldown=True|False
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the Auto Scaling group.

type DesiredCapacity:

integer

param DesiredCapacity:

[REQUIRED]

The number of EC2 instances that should be running in the Auto Scaling group.

type HonorCooldown:

boolean

param HonorCooldown:

By default, SetDesiredCapacity overrides any cooldown period associated with the Auto Scaling group. Specify True to make Auto Scaling to wait for the cool-down period associated with the Auto Scaling group to complete before initiating a scaling activity to set your Auto Scaling group to its new capacity.

returns:

None

DeleteLifecycleHook (new) Link ¶

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

client.delete_lifecycle_hook(
    LifecycleHookName='string',
    AutoScalingGroupName='string'
)
type LifecycleHookName:

string

param LifecycleHookName:

[REQUIRED]

The name of the lifecycle hook.

type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name of the Auto Scaling group for the lifecycle hook.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

DescribeLifecycleHookTypes (new) Link ¶

Describes the available types of lifecycle hooks.

Request Syntax

client.describe_lifecycle_hook_types()
rtype:

dict

returns:

Response Syntax

{
    'LifecycleHookTypes': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • LifecycleHookTypes (list) --

      One or more of the following notification types:

      • autoscaling:EC2_INSTANCE_LAUNCHING

      • autoscaling:EC2_INSTANCE_TERMINATING

      • (string) --

DescribeMetricCollectionTypes (new) Link ¶

Returns a list of metrics and a corresponding list of granularities for each metric.

Request Syntax

client.describe_metric_collection_types()
rtype:

dict

returns:

Response Syntax

{
    'Metrics': [
        {
            'Metric': 'string'
        },
    ],
    'Granularities': [
        {
            'Granularity': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Metrics (list) --

      One or more of the following metrics:

      • GroupMinSize

      • GroupMaxSize

      • GroupDesiredCapacity

      • GroupInServiceInstances

      • GroupPendingInstances

      • GroupStandbyInstances

      • GroupTerminatingInstances

      • GroupTotalInstances

      • (dict) --

        Describes a metric.

        • Metric (string) --

          The metric.

    • Granularities (list) --

      The granularities for the listed metrics.

      • (dict) --

        Describes a granularity of a metric.

        • Granularity (string) --

          The granularity.

DisableMetricsCollection (new) Link ¶

Disables monitoring of the specified metrics for the specified Auto Scaling group.

Request Syntax

client.disable_metrics_collection(
    AutoScalingGroupName='string',
    Metrics=[
        'string',
    ]
)
type AutoScalingGroupName:

string

param AutoScalingGroupName:

[REQUIRED]

The name or Amazon Resource Name (ARN) of the group.

type Metrics:

list

param Metrics:

One or more of the following metrics:

  • GroupMinSize

  • GroupMaxSize

  • GroupDesiredCapacity

  • GroupInServiceInstances

  • GroupPendingInstances

  • GroupStandbyInstances

  • GroupTerminatingInstances

  • GroupTotalInstances

If you omit this parameter, all metrics are disabled.

  • (string) --

returns:

None

DeleteTags (new) Link ¶

Deletes the specified tags.

Request Syntax

client.delete_tags(
    Tags=[
        {
            'ResourceId': 'string',
            'ResourceType': 'string',
            'Key': 'string',
            'Value': 'string',
            'PropagateAtLaunch': True|False
        },
    ]
)
type Tags:

list

param Tags:

[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.

  • (dict) --

    Describes a tag applied to an Auto Scaling group.

    • ResourceId (string) --

      The name of the group.

    • ResourceType (string) --

      The kind of resource to which the tag is applied. Currently, Auto Scaling supports the auto-scaling-group resource type.

    • Key (string) -- [REQUIRED]

      The tag key.

    • Value (string) --

      The tag value.

    • PropagateAtLaunch (boolean) --

      Specifies whether the tag is applied to instances launched after the tag is created. The same behavior applies to updates: If you change a tag, it is applied to all instances launched after you made the change.

returns:

None

DescribeAutoScalingNotificationTypes (new) Link ¶

Lists the notification types that are supported by Auto Scaling.

Request Syntax

client.describe_auto_scaling_notification_types()
rtype:

dict

returns:

Response Syntax

{
    'AutoScalingNotificationTypes': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • AutoScalingNotificationTypes (list) --

      One or more of the following notification types:

      • autoscaling:EC2_INSTANCE_LAUNCH

      • autoscaling:EC2_INSTANCE_LAUNCH_ERROR

      • autoscaling:EC2_INSTANCE_TERMINATE

      • autoscaling:EC2_INSTANCE_TERMINATE_ERROR

      • autoscaling:TEST_NOTIFICATION

      • (string) --