Auto Scaling

2014/10/16 - Auto Scaling - 45 new api methods

DeleteAutoScalingGroup (new) Link ¶

Deletes the specified Auto Scaling group if the group has no instances and no scaling activities in progress.

Request Syntax

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

string

param AutoScalingGroupName

[REQUIRED]

The name of the Auto Scaling group to delete.

type ForceDelete

boolean

param ForceDelete

Starting with API version 2011-01-01, specifies that the Auto Scaling 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

TerminateInstanceInAutoScalingGroup (new) Link ¶

Terminates the specified instance. Optionally, the desired group size can be adjusted.

Request Syntax

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

string

param InstanceId

[REQUIRED]

The ID of the Amazon EC2 instance to be terminated.

type ShouldDecrementDesiredCapacity

boolean

param ShouldDecrementDesiredCapacity

[REQUIRED]

Specifies whether (true ) or not (false ) terminating this instance should also decrement the size of the AutoScalingGroup.

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) --

    The output for the TerminateInstanceInAutoScalingGroup action.

    • Activity (dict) --

      A scaling Activity.

      • ActivityId (string) --

        Specifies the ID of the activity.

      • AutoScalingGroupName (string) --

        The name of the Auto Scaling group.

      • Description (string) --

        Contains a friendly, more verbose description of the scaling activity.

      • Cause (string) --

        Contains the reason the activity was begun.

      • StartTime (datetime) --

        Provides the start time of this activity.

      • EndTime (datetime) --

        Provides the end time of this activity.

      • StatusCode (string) --

        Contains the current status of the activity.

      • StatusMessage (string) --

        Contains a friendly, more verbose description of the activity status.

      • Progress (integer) --

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

      • Details (string) --

        Contains details of the scaling activity.

DescribeAutoScalingGroups (new) Link ¶

Returns a full description of each Auto Scaling group in the given list. This includes all Amazon EC2 instances that are members of the group. If a list of names is not provided, the service returns the full details of all Auto Scaling groups.

This action supports pagination by returning a token if there are more pages to retrieve. To get the next page, call this action again with the returned token as the NextToken parameter.

Request Syntax

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

list

param AutoScalingGroupNames

A list of Auto Scaling group names.

  • (string) --

type NextToken

string

param NextToken

A string that marks the start of the next batch of returned results.

type MaxRecords

integer

param MaxRecords

The maximum number of records to return.

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) --

    The AutoScalingGroupsType data type.

    • AutoScalingGroups (list) --

      A list of Auto Scaling groups.

      • (dict) --

        The AutoScalingGroup data type.

        • AutoScalingGroupName (string) --

          Specifies the name of the group.

        • AutoScalingGroupARN (string) --

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

        • LaunchConfigurationName (string) --

          Specifies the name of the associated LaunchConfiguration.

        • MinSize (integer) --

          Contains the minimum size of the Auto Scaling group.

        • MaxSize (integer) --

          Contains the maximum size of the Auto Scaling group.

        • DesiredCapacity (integer) --

          Specifies the desired capacity for the Auto Scaling group.

        • DefaultCooldown (integer) --

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

        • AvailabilityZones (list) --

          Contains a list of Availability Zones for the group.

          • (string) --

        • LoadBalancerNames (list) --

          A list of load balancers associated with this Auto Scaling group.

          • (string) --

        • HealthCheckType (string) --

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

        • HealthCheckGracePeriod (integer) --

          The length 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) --

          Provides a summary list of Amazon EC2 instances.

          • (dict) --

            The Instance data type.

            • InstanceId (string) --

              Specifies the ID of the Amazon EC2 instance.

            • AvailabilityZone (string) --

              Availability Zones associated with this instance.

            • LifecycleState (string) --

              Contains a description of the current lifecycle state.

            • HealthStatus (string) --

              The instance's health status.

            • LaunchConfigurationName (string) --

              The launch configuration associated with this instance.

        • CreatedTime (datetime) --

          Specifies the date and time the Auto Scaling group was created.

        • SuspendedProcesses (list) --

          Suspended processes associated with this Auto Scaling group.

          • (dict) --

            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 cluster placement group, if applicable. For more information, go to Using Cluster Instances in the Amazon EC2 User Guide.

        • VPCZoneIdentifier (string) --

          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 .

        • EnabledMetrics (list) --

          A list of metrics enabled for this Auto Scaling group.

          • (dict) --

            The EnabledMetric data type.

            • Metric (string) --

              The name of the enabled metric.

            • Granularity (string) --

              The granularity of the enabled metric.

        • Status (string) --

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

        • Tags (list) --

          A list of tags for the Auto Scaling group.

          • (dict) --

            The tag applied to an Auto Scaling group.

            • ResourceId (string) --

              The name of the Auto Scaling 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 key of the tag.

            • Value (string) --

              The value of the tag.

            • PropagateAtLaunch (boolean) --

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

        • TerminationPolicies (list) --

          A standalone termination policy or a list of termination policies for this Auto Scaling group.

          • (string) --

    • NextToken (string) --

      A string that marks the start of the next batch of returned results.

ExitStandby (new) Link ¶

Move an instance out of Standby mode.

To learn more about how to put instances that are in a Standby mode back into service, see Auto Scaling InService State.

Request Syntax

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

list

param InstanceIds

A list of instances to move out of Standby mode. You must specify at least one instance ID.

  • (string) --

type AutoScalingGroupName

string

param AutoScalingGroupName

[REQUIRED]

The name of the Auto Scaling group from which to move instances out of 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) --

    The output of the ExitStandby action.

    • Activities (list) --

      A list describing the activities related to moving instances out of Standby mode.

      • (dict) --

        A scaling Activity is a long-running process that represents a change to your AutoScalingGroup, such as changing the size of the group. It can also be a process to replace an instance, or a process to perform any other long-running operations supported by the API.

        • ActivityId (string) --

          Specifies the ID of the activity.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group.

        • Description (string) --

          Contains a friendly, more verbose description of the scaling activity.

        • Cause (string) --

          Contains the reason the activity was begun.

        • StartTime (datetime) --

          Provides the start time of this activity.

        • EndTime (datetime) --

          Provides the end time of this activity.

        • StatusCode (string) --

          Contains the current status of the activity.

        • StatusMessage (string) --

          Contains a friendly, more verbose description of the activity status.

        • Progress (integer) --

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

        • Details (string) --

          Contains details of the scaling activity.

SetInstanceHealth (new) Link ¶

Sets the health status of a specified instance that belongs to any of your Auto Scaling groups.

For more information, see Configure Health Checks for Your Auto Scaling group.

Request Syntax

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

string

param InstanceId

[REQUIRED]

The identifier of the Amazon 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 in the CreateAutoScalingGroup action.

returns

None

DeleteNotificationConfiguration (new) Link ¶

Deletes notifications created by PutNotificationConfiguration.

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

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 the PutLifecycleHook operation.

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.

To learn more, see Auto Scaling Pending State and Auto Scaling Terminating State.

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 to which the hook belongs.

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) --

    The output of the RecordLifecycleActionHeartbeat action.

SuspendProcesses (new) Link ¶

Suspends Auto Scaling processes for an Auto Scaling group. To suspend specific process types, specify them by name with the ScalingProcesses.member.N parameter. To suspend all process types, omit the ScalingProcesses.member.N parameter.

Warning

Suspending either of the two primary process types, Launch or Terminate , can prevent other process types from functioning properly.

To resume processes that have been suspended, use ResumeProcesses For more information on suspending and resuming Auto Scaling process, see Suspend and Resume Auto Scaling Process.

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

The processes that you want to suspend or resume, which can include one or more of the following:

  • Launch

  • Terminate

  • HealthCheck

  • ReplaceUnhealthy

  • AZRebalance

  • AlarmNotification

  • ScheduledActions

  • AddToLoadBalancer

To suspend all process types, omit this parameter.

  • (string) --

returns

None

DescribeAutoScalingInstances (new) Link ¶

Returns a description of each Auto Scaling instance in the InstanceIds list. If a list is not provided, the service returns the full details of all instances up to a maximum of 50. By default, the service returns a list of 20 items.

This action supports pagination by returning a token if there are more pages to retrieve. To get the next page, call this action again with the returned token as the NextToken parameter.

Request Syntax

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

list

param InstanceIds

The list of Auto Scaling instances to describe. If this list is omitted, all auto scaling instances are described. The list of requested instances cannot contain more than 50 items. If unknown instances are requested, they are ignored with no error.

  • (string) --

type MaxRecords

integer

param MaxRecords

The maximum number of Auto Scaling instances to be described with each call.

type NextToken

string

param NextToken

The token returned by a previous call to indicate that there is more data available.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    The AutoScalingInstancesType data type.

    • AutoScalingInstances (list) --

      A list of Auto Scaling instances.

      • (dict) --

        The AutoScalingInstanceDetails data type.

        • InstanceId (string) --

          The instance ID of the Amazon EC2 instance.

        • AutoScalingGroupName (string) --

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

        • AvailabilityZone (string) --

          The Availability Zone in which this instance resides.

        • LifecycleState (string) --

          The life cycle state of this instance. for more information, see Instance Lifecycle State 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. Auto Scaling should terminate and replace it.

        • LaunchConfigurationName (string) --

          The launch configuration associated with this instance.

    • NextToken (string) --

      A string that marks the start of the next batch of returned results.

DeleteLaunchConfiguration (new) Link ¶

Deletes the specified LaunchConfiguration.

The specified 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

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 to which the lifecycle hook belongs.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output of the DeleteLifecycleHook action.

CreateLaunchConfiguration (new) Link ¶

Creates a new launch configuration. The launch configuration name must be unique within the scope of the client's AWS account. The maximum limit of launch configurations, which by default is 100, must not yet have been met; otherwise, the call will fail. When created, the new launch configuration is available for immediate use.

Request Syntax

client.create_launch_configuration(
    LaunchConfigurationName='string',
    ImageId='string',
    KeyName='string',
    SecurityGroups=[
        '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 to create.

type ImageId

string

param ImageId

Unique ID of the Amazon Machine Image (AMI) you want to use to launch your EC2 instances. For information about finding Amazon EC2 AMIs, see Finding a Suitable AMI in the Amazon Elastic Compute Cloud User Guide .

type KeyName

string

param KeyName

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

type SecurityGroups

list

param SecurityGroups

The security groups with which to associate Amazon EC2 or Amazon VPC instances.

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

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

  • (string) --

type UserData

string

param UserData

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

type InstanceId

string

param InstanceId

The ID of the Amazon EC2 instance you want to use to create the launch configuration. Use this attribute if you want the launch configuration to derive its attributes from an EC2 instance.

When you use an instance to create a launch configuration, all you need to specify is the InstanceId . The new launch configuration, by default, derives all the attributes from the specified instance with the exception of BlockDeviceMapping .

If you want to create a launch configuration with BlockDeviceMapping or override any other instance attributes, specify them as part of the same request.

For more information on using an InstanceID to create a launch configuration, see Create a Launch Configuration Using an Amazon 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

A list of mappings that specify how block devices are exposed to the instance. Each mapping is made up of a VirtualName , a DeviceName , and an ebs data structure that contains information about the associated Elastic Block Storage volume. For more information about Amazon EC2 BlockDeviceMappings, go to Block Device Mapping in the Amazon EC2 product documentation.

  • (dict) --

    The BlockDeviceMapping data type.

    • VirtualName (string) --

      The virtual name associated with the device.

    • DeviceName (string) -- [REQUIRED]

      The name of the device within Amazon EC2 (for example, /dev/sdh or xvdh).

    • Ebs (dict) --

      The Elastic Block Storage volume information.

      • SnapshotId (string) --

        The snapshot ID.

      • VolumeSize (integer) --

        The volume size, in gigabytes.

        Valid values: If the volume type is io1 , the minimum size of the volume is 10.

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

        Required: Required when the volume type is io1 .

      • VolumeType (string) --

        The volume type.

        Valid values: standard | io1

        Default: standard

      • DeleteOnTermination (boolean) --

        Indicates whether to delete the volume on instance termination.

        Default: true

      • Iops (integer) --

        The number of I/O operations per second (IOPS) that the volume supports.

        The maximum ratio of IOPS to volume size is 30.0

        Valid Values: Range is 100 to 4000.

        Default: None.

    • NoDevice (boolean) --

      Suppresses the 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 will generate metrics every minute and your account will be charged a fee. When you disable detailed monitoring, by specifying False , Cloudwatch will generate metrics every 5 minutes. For more information, see Monitor Your Auto Scaling Instances. For information about Amazon CloudWatch, see the Amazon CloudWatch 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 on launching Spot Instances, see Using Auto Scaling to Launch Spot Instances 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 information on launching EC2 instances with an IAM role, go to Launching Auto Scaling Instances With an IAM Role in the Auto Scaling Developer Guide .

type EbsOptimized

boolean

param EbsOptimized

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

type AssociatePublicIpAddress

boolean

param AssociatePublicIpAddress

Used for Auto Scaling groups that launch instances into an Amazon Virtual Private Cloud (Amazon VPC). Specifies whether to assign a public IP address to each instance launched in a Amazon VPC. For more information, see Auto Scaling in Amazon Virtual Private Cloud.

Default: If the instance is launched into a default subnet in a default VPC, the default is true . If the instance is launched into a nondefault subnet in a VPC, the default is false . For information about default VPC and VPC platforms, see Supported Platforms.

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 Auto Scaling group.

For more information, see Auto Scaling in Amazon Virtual Private Cloud in the Auto Scaling Developer Guide .

Valid values: default | dedicated

returns

None

DeleteTags (new) Link ¶

Removes the specified tags or a set of tags from a set of resources.

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) --

    The tag applied to an Auto Scaling group.

    • ResourceId (string) --

      The name of the Auto Scaling 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 key of the tag.

    • Value (string) --

      The value of the tag.

    • PropagateAtLaunch (boolean) --

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

returns

None

SetDesiredCapacity (new) Link ¶

Sets the desired 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 new capacity setting for the Auto Scaling group.

type HonorCooldown

boolean

param HonorCooldown

By default, SetDesiredCapacity overrides any cooldown period associated with the Auto Scaling group. Set to True if you want Auto Scaling to wait for the cooldown period associated with the Auto Scaling group to complete before initiating a scaling activity to set your Auto Scaling group to the new capacity setting.

returns

None

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 information on creating or updating a scheduled action for your Auto Scaling group, see Scale Based on a Schedule.

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

DescribeNotificationConfigurations (new) Link ¶

Returns a list of notification actions associated with Auto Scaling groups for specified events.

Request Syntax

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

list

param AutoScalingGroupNames

The name of the Auto Scaling group.

  • (string) --

type NextToken

string

param NextToken

A string that is used to mark the start of the next batch of returned results for pagination.

type MaxRecords

integer

param MaxRecords

Maximum number of records to be returned.

rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    The output of the DescribeNotificationConfigurations action.

    • NotificationConfigurations (list) --

      The list of notification configurations.

      • (dict) --

        The NotificationConfiguration data type.

        • AutoScalingGroupName (string) --

          Specifies the Auto Scaling group name.

        • 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) --

      A string that is used to mark the start of the next batch of returned results for pagination.

CreateOrUpdateTags (new) Link ¶

Creates new tags or updates existing tags for an Auto Scaling group.

For information on creating tags for your Auto Scaling group, see Tag Your Auto Scaling Groups and Amazon EC2 Instances.

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 Auto Scaling 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 Auto Scaling 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) --

    The tag applied to an Auto Scaling group.

    • ResourceId (string) --

      The name of the Auto Scaling 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 key of the tag.

    • Value (string) --

      The value of the tag.

    • PropagateAtLaunch (boolean) --

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

returns

None

DescribeLaunchConfigurations (new) Link ¶

Returns a full description of the launch configurations, or the specified launch configurations, if they exist.

If no name is specified, then the full details of all launch configurations are returned.

Request Syntax

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

list

param LaunchConfigurationNames

A list of launch configuration names.

  • (string) --

type NextToken

string

param NextToken

A string that marks the start of the next batch of returned results.

type MaxRecords

integer

param MaxRecords

The maximum number of launch configurations. The default is 100.

rtype

dict

returns

Response Syntax

{
    'LaunchConfigurations': [
        {
            'LaunchConfigurationName': 'string',
            'LaunchConfigurationARN': 'string',
            'ImageId': 'string',
            'KeyName': 'string',
            'SecurityGroups': [
                '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) --

    The LaunchConfigurationsType data type.

    • LaunchConfigurations (list) --

      A list of launch configurations.

      • (dict) --

        The LaunchConfiguration data type.

        • LaunchConfigurationName (string) --

          Specifies the name of the launch configuration.

        • LaunchConfigurationARN (string) --

          The launch configuration's Amazon Resource Name (ARN).

        • ImageId (string) --

          Provides the unique ID of the Amazon Machine Image (AMI) that was assigned during registration.

        • KeyName (string) --

          Provides the name of the Amazon EC2 key pair.

        • SecurityGroups (list) --

          A description of the security groups to associate with the Amazon EC2 instances.

          • (string) --

        • UserData (string) --

          The user data available to the launched Amazon EC2 instances.

        • InstanceType (string) --

          Specifies the instance type of the Amazon EC2 instance.

        • KernelId (string) --

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

        • RamdiskId (string) --

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

        • BlockDeviceMappings (list) --

          Specifies how block devices are exposed to the instance. Each mapping is made up of a virtualName and a deviceName .

          • (dict) --

            The BlockDeviceMapping data type.

            • VirtualName (string) --

              The virtual name associated with the device.

            • DeviceName (string) --

              The name of the device within Amazon EC2 (for example, /dev/sdh or xvdh).

            • Ebs (dict) --

              The Elastic Block Storage volume information.

              • SnapshotId (string) --

                The snapshot ID.

              • VolumeSize (integer) --

                The volume size, in gigabytes.

                Valid values: If the volume type is io1 , the minimum size of the volume is 10.

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

                Required: Required when the volume type is io1 .

              • VolumeType (string) --

                The volume type.

                Valid values: standard | io1

                Default: standard

              • DeleteOnTermination (boolean) --

                Indicates whether to delete the volume on instance termination.

                Default: true

              • Iops (integer) --

                The number of I/O operations per second (IOPS) that the volume supports.

                The maximum ratio of IOPS to volume size is 30.0

                Valid Values: Range is 100 to 4000.

                Default: None.

            • NoDevice (boolean) --

              Suppresses the device mapping.

        • InstanceMonitoring (dict) --

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

          • Enabled (boolean) --

            If True , instance monitoring is enabled.

        • SpotPrice (string) --

          Specifies the price to bid when launching Spot Instances.

        • IamInstanceProfile (string) --

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

        • CreatedTime (datetime) --

          Provides the creation date and time for this launch configuration.

        • EbsOptimized (boolean) --

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

        • AssociatePublicIpAddress (boolean) --

          Specifies whether the instance is associated with a public IP address ( true ) or not ( false ).

        • PlacementTenancy (string) --

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

    • NextToken (string) --

      A string that marks the start of the next batch of returned results.

DescribePolicies (new) Link ¶

Returns descriptions of what each policy does. This action supports pagination. If the response includes a token, there are more records available. To get the additional records, repeat the request with the response token as 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 Auto Scaling group.

type PolicyNames

list

param PolicyNames

A list of policy names or policy ARNs to be described. If this list is omitted, all policy names are described. If an auto scaling group name is provided, the results are limited to that group. The list of requested policy names cannot contain more than 50 items. If unknown policy names are requested, they are ignored with no error.

  • (string) --

type NextToken

string

param NextToken

A string that is used to mark the start of the next batch of returned results for pagination.

type MaxRecords

integer

param MaxRecords

The maximum number of policies that will be described 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) --

    The PoliciesType data type.

    • ScalingPolicies (list) --

      A list of scaling policies.

      • (dict) --

        The ScalingPolicy data type.

        • 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) --

          A list of CloudWatch Alarms related to the policy.

          • (dict) --

            The Alarm data type.

            • 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) --

      A string that marks the start of the next batch of returned results.

ResumeProcesses (new) Link ¶

Resumes all suspended Auto Scaling processes for an Auto Scaling group. For information on suspending and resuming Auto Scaling process, see Suspend and Resume Auto Scaling Process.

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

The processes that you want to suspend or resume, which can include one or more of the following:

  • Launch

  • Terminate

  • HealthCheck

  • ReplaceUnhealthy

  • AZRebalance

  • AlarmNotification

  • ScheduledActions

  • AddToLoadBalancer

To suspend all process types, omit this parameter.

  • (string) --

returns

None

PutLifecycleHook (new) Link ¶

Creates or updates a lifecycle hook for an 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.

To learn more, see Auto Scaling Pending State and Auto Scaling Terminating State.

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 Amazon 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) --

    The output of the PutLifecycleHook action.

EnterStandby (new) Link ¶

Move instances in an Auto Scaling group into a Standby mode.

To learn more about how to put instances into a Standby mode, see Auto Scaling InService State.

Request Syntax

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

list

param InstanceIds

The 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 from which to move instances into Standby mode.

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) --

    The output of the EnterStandby action.

    • Activities (list) --

      A list describing the activities related to moving instances into Standby mode.

      • (dict) --

        A scaling Activity is a long-running process that represents a change to your AutoScalingGroup, such as changing the size of the group. It can also be a process to replace an instance, or a process to perform any other long-running operations supported by the API.

        • ActivityId (string) --

          Specifies the ID of the activity.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group.

        • Description (string) --

          Contains a friendly, more verbose description of the scaling activity.

        • Cause (string) --

          Contains the reason the activity was begun.

        • StartTime (datetime) --

          Provides the start time of this activity.

        • EndTime (datetime) --

          Provides the end time of this activity.

        • StatusCode (string) --

          Contains the current status of the activity.

        • StatusMessage (string) --

          Contains a friendly, more verbose description of the activity status.

        • Progress (integer) --

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

        • Details (string) --

          Contains details of the scaling activity.

DescribeAccountLimits (new) Link ¶

Returns the limits for the Auto Scaling resources currently allowed for your AWS account.

Your AWS account comes with default limits on resources for Auto Scaling. There is a default limit of 20 Auto Scaling groups and 100 launch configurations per region.

If you reach the limits for the number of Auto Scaling groups or the launch configurations, you can go to the Support Center and place a request to raise the limits.

Request Syntax

client.describe_account_limits()
rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    The output of the DescribeAccountLimitsResult action.

    • MaxNumberOfAutoScalingGroups (integer) --

      The maximum number of Auto Scaling groups allowed for your AWS account.

    • MaxNumberOfLaunchConfigurations (integer) --

      The maximum number of launch configurations allowed for your AWS account.

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.

To learn more, see Auto Scaling Pending State and Auto Scaling Terminating State.

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 Auto Scaling group to which the lifecycle hook belongs.

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 the Auto Scaling group should take. The value for this parameter can be either CONTINUE or ABANDON .

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output of the CompleteLifecycleAction.

DetachInstances (new) Link ¶

Using DetachInstances , you can remove an instance from an Auto Scaling group. After the instances are detached, you can manage them independently from the rest of the Auto Scaling group.

To learn more about detaching instances, see Detach Amazon EC2 Instances From Your Auto Scaling Group.

Request Syntax

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

list

param InstanceIds

A list of instances to detach from the Auto Scaling group. You must specify at least one instance ID.

  • (string) --

type AutoScalingGroupName

string

param AutoScalingGroupName

[REQUIRED]

The name of the Auto Scaling group from which to detach instances.

type ShouldDecrementDesiredCapacity

boolean

param ShouldDecrementDesiredCapacity

[REQUIRED]

Specifies if the detached instance should decrement the desired capacity value for the Auto Scaling group. If set to 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) --

    The output of the DetachInstances action.

    • Activities (list) --

      A list describing the activities related to detaching the instances from the Auto Scaling group.

      • (dict) --

        A scaling Activity is a long-running process that represents a change to your AutoScalingGroup, such as changing the size of the group. It can also be a process to replace an instance, or a process to perform any other long-running operations supported by the API.

        • ActivityId (string) --

          Specifies the ID of the activity.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group.

        • Description (string) --

          Contains a friendly, more verbose description of the scaling activity.

        • Cause (string) --

          Contains the reason the activity was begun.

        • StartTime (datetime) --

          Provides the start time of this activity.

        • EndTime (datetime) --

          Provides the end time of this activity.

        • StatusCode (string) --

          Contains the current status of the activity.

        • StatusMessage (string) --

          Contains a friendly, more verbose description of the activity status.

        • Progress (integer) --

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

        • Details (string) --

          Contains details of the scaling activity.

DescribeAutoScalingNotificationTypes (new) Link ¶

Returns a list of all 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) --

    The AutoScalingNotificationTypes data type.

    • AutoScalingNotificationTypes (list) --

      Returns a list of all notification types supported by Auto Scaling. They are:

      • autoscaling:EC2_INSTANCE_LAUNCH

      • autoscaling:EC2_INSTANCE_LAUNCH_ERROR

      • autoscaling:EC2_INSTANCE_TERMINATE

      • autoscaling:EC2_INSTANCE_TERMINATE_ERROR

      • autoscaling:TEST_NOTIFICATION

      • (string) --

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) --

      Returns a list of all notification types supported by Auto Scaling. They are:

      • autoscaling:EC2_INSTANCE_LAUNCHING

      • autoscaling:EC2_INSTANCE_TERMINATING

      • (string) --

DescribeScalingActivities (new) Link ¶

Returns the scaling activities for the specified Auto Scaling group.

If the specified ActivityIds list is empty, all the activities from the past six weeks are returned. Activities are sorted by the start time. Activities still in progress appear first on the list.

This action supports pagination. If the response includes a token, there are more records available. To get the additional records, repeat the request with the response token as 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 AutoScalingGroup.

type MaxRecords

integer

param MaxRecords

The maximum number of scaling activities to return.

type NextToken

string

param NextToken

A string that marks the start of the next batch of returned results for pagination.

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) --

    The output for the DescribeScalingActivities action.

    • Activities (list) --

      A list of the requested scaling activities.

      • (dict) --

        A scaling Activity is a long-running process that represents a change to your AutoScalingGroup, such as changing the size of the group. It can also be a process to replace an instance, or a process to perform any other long-running operations supported by the API.

        • ActivityId (string) --

          Specifies the ID of the activity.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group.

        • Description (string) --

          Contains a friendly, more verbose description of the scaling activity.

        • Cause (string) --

          Contains the reason the activity was begun.

        • StartTime (datetime) --

          Provides the start time of this activity.

        • EndTime (datetime) --

          Provides the end time of this activity.

        • StatusCode (string) --

          Contains the current status of the activity.

        • StatusMessage (string) --

          Contains a friendly, more verbose description of the activity status.

        • Progress (integer) --

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

        • Details (string) --

          Contains details of the scaling activity.

    • NextToken (string) --

      Acts as a paging mechanism for large result sets. Set to a non-empty string if there are additional results waiting to be returned. Pass this in to subsequent calls to return additional results.

DisableMetricsCollection (new) Link ¶

Disables monitoring of group metrics for the Auto Scaling group specified in AutoScalingGroupName . You can specify the list of affected metrics with the Metrics parameter.

Request Syntax

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

string

param AutoScalingGroupName

[REQUIRED]

The name or ARN of the Auto Scaling Group.

type Metrics

list

param Metrics

The list of metrics to disable. If no metrics are specified, all metrics are disabled. The following metrics are supported:

  • GroupMinSize

  • GroupMaxSize

  • GroupDesiredCapacity

  • GroupInServiceInstances

  • GroupPendingInstances

  • GroupStandbyInstances

  • GroupTerminatingInstances

  • GroupTotalInstances

  • (string) --

returns

None

DescribeTags (new) Link ¶

Lists the Auto Scaling group tags.

You can use filters to limit results when describing tags. For example, you can query for tags of a particular 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 your 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) --

    The Filter data type.

    • Name (string) --

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

    • Values (list) --

      The value of the filter.

      • (string) --

type NextToken

string

param NextToken

A string that marks the start of the next batch of returned results.

type MaxRecords

integer

param MaxRecords

The maximum number of records to return.

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 list of tags.

      • (dict) --

        The tag applied to an Auto Scaling group.

        • ResourceId (string) --

          The name of the Auto Scaling 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 key of the tag.

        • Value (string) --

          The value of the tag.

        • PropagateAtLaunch (boolean) --

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

    • NextToken (string) --

      A string used to mark the start of the next batch of returned results.

CreateAutoScalingGroup (new) Link ¶

Creates a new Auto Scaling group with the specified name and other attributes. When the creation request is completed, the Auto Scaling group is ready to be used in other calls.

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 Auto Scaling group.

type LaunchConfigurationName

string

param LaunchConfigurationName

The name of an existing launch configuration to use to launch new instances. Use this attribute if you want to create an Auto Scaling group using an existing launch configuration instead of an EC2 instance.

type InstanceId

string

param InstanceId

The ID of the Amazon EC2 instance you want to use to create the Auto Scaling group. Use this attribute if you want to create an Auto Scaling group using an EC2 instance instead of a launch configuration.

When you use an instance to create an Auto Scaling group, a new launch configuration is first created and then associated with the Auto Scaling group. The new launch configuration derives all its attributes from the instance that is used to create the Auto Scaling group, with the exception of BlockDeviceMapping .

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

type MinSize

integer

param MinSize

[REQUIRED]

The minimum size of the Auto Scaling group.

type MaxSize

integer

param MaxSize

[REQUIRED]

The maximum size of the Auto Scaling group.

type DesiredCapacity

integer

param DesiredCapacity

The number of Amazon EC2 instances that should be running in the group. The desired capacity must be greater than or equal to the minimum size and less than or equal to the maximum size specified for the Auto Scaling group.

type DefaultCooldown

integer

param DefaultCooldown

The amount of time, in seconds, between a successful scaling activity and the succeeding scaling activity.

If a DefaultCooldown period is not specified, Auto Scaling uses the default value of 300 as the default cool down period for the Auto Scaling group. For more information, see Cooldown Period

type AvailabilityZones

list

param AvailabilityZones

A list of Availability Zones for the Auto Scaling group. This is required unless you have specified subnets.

  • (string) --

type LoadBalancerNames

list

param LoadBalancerNames

A list of existing Elastic Load Balancing load balancers to use. The load balancers must be associated with the AWS account.

For information on using load balancers, see Load Balance Your Auto Scaling Group in the Auto Scaling Developer Guide .

  • (string) --

type HealthCheckType

string

param HealthCheckType

The service you want the health checks from, Amazon EC2 or Elastic Load Balancer. Valid values are EC2 or ELB .

By default, the Auto Scaling health check uses the results of Amazon EC2 instance status checks to determine the health of an instance. For more information, see Health Check.

type HealthCheckGracePeriod

integer

param HealthCheckGracePeriod

Length of time in seconds after a new Amazon EC2 instance comes into service that Auto Scaling starts checking its health. During this time any health check failure for the that instance is ignored.

This is required if you are adding 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.

type PlacementGroup

string

param PlacementGroup

Physical location of an existing cluster placement group into which you want to launch your instances. For information about cluster placement group, see Using Cluster Instances

type VPCZoneIdentifier

string

param VPCZoneIdentifier

A comma-separated list of subnet identifiers of Amazon Virtual Private Clouds (Amazon VPCs).

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

For information on launching your Auto Scaling group into Amazon VPC subnets, see Auto Scaling in Amazon Virtual Private Cloud 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 on configuring a termination policy for your Auto Scaling group, see Instance 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 information about using tags, see Tag Your Auto Scaling Groups and Amazon EC2 Instances in the Auto Scaling Developer Guide .

  • (dict) --

    The tag applied to an Auto Scaling group.

    • ResourceId (string) --

      The name of the Auto Scaling 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 key of the tag.

    • Value (string) --

      The value of the tag.

    • PropagateAtLaunch (boolean) --

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

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 Get Email Notifications When Your Auto Scaling Group Changes

A new PutNotificationConfiguration 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

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) --

    The output of the DescribeScalingProcessTypes action.

    • Processes (list) --

      A list of ProcessType names.

      • (dict) --

        There are two primary Auto Scaling process types-- Launch and Terminate . The Launch process creates a new Amazon EC2 instance for an Auto Scaling group, and the Terminate process removes an existing Amazon EC2 instance.

        The remaining Auto Scaling process types relate to specific Auto Scaling features:

        • AddToLoadBalancer

        • AlarmNotification

        • AZRebalance

        • HealthCheck

        • ReplaceUnhealthy

        • ScheduledActions

        Warning

        If you suspend Launch or Terminate , all other process types are affected to varying degrees. The following descriptions discuss how each process type is affected by a suspension of Launch or Terminate .

        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 the RegisterInstancesWithLoadBalancer call in the Elastic Load Balancing API Reference .

        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.

        Warning

        If you call SuspendProcesses on the launch process type, the AZRebalance process will neither launch new instances nor terminate existing instances. This is because the AZRebalance process terminates existing instances only after launching the replacement instances.

        If you call SuspendProcesses on the terminate process type, the AZRebalance process can cause your Auto Scaling group to grow up to ten percent larger than the maximum size. This is because Auto Scaling allows groups to temporarily grow larger than the maximum size during rebalancing activities. If Auto Scaling cannot terminate instances, your Auto Scaling group could remain up to ten percent larger than the maximum size until you resume the terminate process type.

        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 .

        Warning

        The HealthCheck process type works in conjunction with the ReplaceUnhealthly process type to provide health check functionality. If you suspend either Launch or Terminate , the ReplaceUnhealthy process type will not function properly.

        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 a process.

DeleteScheduledAction (new) Link ¶

Deletes a scheduled action previously created using the PutScheduledUpdateGroupAction.

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 you want to delete.

returns

None

AttachInstances (new) Link ¶

Attaches one or more Amazon EC2 instances to an existing Auto Scaling group. After the instance(s) is attached, it becomes a part of the 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 IDs of the Amazon EC2 instances to attach to the specified Auto Scaling group. You must specify at least one instance ID.

  • (string) --

type AutoScalingGroupName

string

param AutoScalingGroupName

[REQUIRED]

The name of the Auto Scaling group to which to attach the specified instance(s).

returns

None

DeletePolicy (new) Link ¶

Deletes a policy created by PutScalingPolicy.

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 PolicyARN of the policy you want to delete.

returns

None

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) --

    The output of the DescribeMetricCollectionTypes action.

    • Metrics (list) --

      The list of Metrics collected. The following metrics are supported:

      • GroupMinSize

      • GroupMaxSize

      • GroupDesiredCapacity

      • GroupInServiceInstances

      • GroupPendingInstances

      • GroupStandbyInstances

      • GroupTerminatingInstances

      • GroupTotalInstances

      • (dict) --

        The MetricCollectionType data type.

        • Metric (string) --

    • Granularities (list) --

      A list of granularities for the listed Metrics.

      • (dict) --

        The MetricGranularityType data type.

        • Granularity (string) --

          The granularity of a Metric.

DescribeTerminationPolicyTypes (new) Link ¶

Returns a list of all termination policies supported by Auto Scaling.

Request Syntax

client.describe_termination_policy_types()
rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    The TerminationPolicyTypes data type.

    • TerminationPolicyTypes (list) --

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

      • (string) --

EnableMetricsCollection (new) Link ¶

Enables monitoring of group metrics for the Auto Scaling group specified in AutoScalingGroupName . You can specify the list of enabled metrics with the Metrics parameter.

Auto Scaling metrics collection can be turned on only if the InstanceMonitoring flag, in the Auto Scaling group's launch configuration, 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

The list of metrics to collect. If no metrics are specified, all metrics are enabled. The following metrics are supported:

  • GroupMinSize

  • GroupMaxSize

  • GroupDesiredCapacity

  • GroupInServiceInstances

  • GroupPendingInstances

  • GroupStandbyInstances

  • GroupTerminatingInstances

  • GroupTotalInstances

  • (string) --

type Granularity

string

param Granularity

[REQUIRED]

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

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 parameter(s) 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 Auto Scaling group.

type PolicyName

string

param PolicyName

[REQUIRED]

The name of the policy you want to create or update.

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 about the adjustment types supported by Auto Scaling, see Scale Based on Demand.

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 Cooldown Period

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) --

    The PolicyARNType data type.

    • PolicyARN (string) --

      A policy's Amazon Resource Name (ARN).

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 desired capacity for the Auto Scaling group.

type DefaultCooldown

integer

param DefaultCooldown

The amount of time, in seconds, after a scaling activity completes before any further scaling activities can start. For more information, see Cooldown Period.

type AvailabilityZones

list

param AvailabilityZones

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 length of time that Auto Scaling waits before checking an instance's health status. 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 cluster placement group, if applicable. For more information, go to Using Cluster Instances in the Amazon EC2 User Guide.

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 on creating your Auto Scaling group in Amazon VPC by specifying subnets, see Launch Auto Scaling Instances into Amazon VPC in the 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 on creating a termination policy for your Auto Scaling group, go to Instance Termination Policy for Your Auto Scaling Group in the the Auto Scaling Developer Guide .

  • (string) --

returns

None

DescribeAdjustmentTypes (new) Link ¶

Returns policy adjustment types for use in the PutScalingPolicy action.

Request Syntax

client.describe_adjustment_types()
rtype

dict

returns

Response Syntax

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

Response Structure

  • (dict) --

    The output of the DescribeAdjustmentTypes action.

    • AdjustmentTypes (list) --

      A list of specific policy adjustment types.

      • (dict) --

        Specifies whether the PutScalingPolicy ScalingAdjustment parameter is an absolute number or a percentage of the current capacity.

        • AdjustmentType (string) --

          A policy adjustment type. Valid values are ChangeInCapacity , ExactCapacity , and PercentChangeInCapacity .

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 the Amazon Resource Name (ARN) of the Auto Scaling group.

type PolicyName

string

param PolicyName

[REQUIRED]

The name or ARN of the policy you want to run.

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 information about cooldown period, see Cooldown Period in the Auto Scaling Developer Guide .

returns

None

DescribeLifecycleHooks (new) Link ¶

Describes the lifecycle hooks that currently belong to the specified Auto Scaling group.

Request Syntax

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

string

param AutoScalingGroupName

[REQUIRED]

The name of one or more Auto Scaling groups.

type LifecycleHookNames

list

param LifecycleHookNames

The name 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) --

    The output of the DescribeLifecycleHooks action.

    • LifecycleHooks (list) --

      A list describing the lifecycle hooks that belong to the specified Auto Scaling group.

      • (dict) --

        A lifecycle hook 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

        To learn more, see Auto Scaling Pending State and Auto Scaling Terminating State.

        • LifecycleHookName (string) --

          The name of the lifecycle action hook.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group to which the lifecycle action belongs.

        • LifecycleTransition (string) --

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

        • NotificationTargetARN (string) --

          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:

          • 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 Amazon IAM role that allows the Auto Scaling group to publish to the specified notification target.

        • NotificationMetadata (string) --

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

        • HeartbeatTimeout (integer) --

          Defines 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 value for this parameter can be either CONTINUE or ABANDON . The default value for this parameter is CONTINUE .

DescribeScheduledActions (new) Link ¶

Lists all the actions scheduled for your Auto Scaling group that haven't been executed. To see a list of actions already executed, see the activity record returned in 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 Auto Scaling group.

type ScheduledActionNames

list

param ScheduledActionNames

A list of scheduled actions to be described. If this list is omitted, all scheduled actions are described. The list of requested scheduled actions cannot contain more than 50 items. If an auto scaling group name is provided, the results are limited to that group. If unknown scheduled actions are requested, they are ignored with no error.

  • (string) --

type StartTime

datetime

param StartTime

The earliest scheduled start time to return. If scheduled action names are provided, this field will be ignored.

type EndTime

datetime

param EndTime

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

type NextToken

string

param NextToken

A string that marks the start of the next batch of returned results.

type MaxRecords

integer

param MaxRecords

The maximum number of scheduled actions to return.

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) --

    A scaling action that is scheduled for a future time and date. An action can be scheduled up to thirty days in advance.

    Starting with API version 2011-01-01, you can use recurrence to specify that a scaling action occurs regularly on a schedule.

    • ScheduledUpdateGroupActions (list) --

      A list of scheduled actions designed to update an Auto Scaling group.

      • (dict) --

        This data type stores information about a scheduled update to an Auto Scaling group.

        • AutoScalingGroupName (string) --

          The name of the Auto Scaling group to be updated.

        • ScheduledActionName (string) --

          The name of this scheduled action.

        • ScheduledActionARN (string) --

          The Amazon Resource Name (ARN) of this 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 Auto Scaling group.

        • MaxSize (integer) --

          The maximum size of the Auto Scaling group.

        • DesiredCapacity (integer) --

          The number of instances you prefer to maintain in your Auto Scaling group.

    • NextToken (string) --

      A string that marks the start of the next batch of returned results.