auto_scaling_groups
Creates, updates, deletes, gets or lists an auto_scaling_groups resource.
Overview
| Name | auto_scaling_groups |
| Type | Resource |
| Id | aws.autoscaling.auto_scaling_groups |
Fields
The following fields are returned by SELECT queries:
- describe_auto_scaling_groups
| Name | Datatype | Description |
|---|---|---|
auto_scaling_group_arn | string | The Amazon Resource Name (ARN) of the Auto Scaling group. |
auto_scaling_group_name | string | The name of the Auto Scaling group. |
availability_zone_distribution | string | The EC2 instance capacity distribution across Availability Zones for the Auto Scaling group. |
availability_zone_ids | string | The Availability Zone IDs where the Auto Scaling group can launch instances. |
availability_zone_impairment_policy | string | The Availability Zone impairment policy for the Auto Scaling group. |
availability_zones | string | One or more Availability Zones for the Auto Scaling group. |
capacity_rebalance | boolean | Indicates whether Capacity Rebalancing is enabled. |
capacity_reservation_specification | string | The capacity reservation specification for the Auto Scaling group. |
context | string | Reserved. |
created_time | string | The date and time the Auto Scaling group was created. |
default_cooldown | integer | The duration of the default cooldown period, in seconds, for the Auto Scaling group. |
default_instance_warmup | integer | The duration of the default EC2 instance warmup time, in seconds, for the Auto Scaling group. |
deletion_protection | string | The deletion protection setting for the Auto Scaling group. |
desired_capacity | integer | The desired size of the Auto Scaling group. |
desired_capacity_type | string | The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports DesiredCapacityType for attribute-based instance type selection only. |
enabled_metrics | string | The metrics enabled for the Auto Scaling group. |
health_check_grace_period | integer | The duration of the health check grace period, in seconds, for the Auto Scaling group. |
health_check_type | string | One or more comma-separated health check types for the Auto Scaling group. |
instance_lifecycle_policy | string | The instance lifecycle policy for the Auto Scaling group. |
instance_maintenance_policy | string | An instance maintenance policy. |
instances | string | The EC2 instances associated with the Auto Scaling group. |
launch_configuration_name | string | The name of the associated launch configuration for the Auto Scaling group. |
launch_template | string | The launch template for the Auto Scaling group. |
load_balancer_names | string | One or more load balancers associated with the group. |
max_instance_lifetime | integer | The maximum amount of time, in seconds, that an EC2 instance can be in service for the Auto Scaling group. |
max_size | integer | The maximum size of the Auto Scaling group. |
min_size | integer | The minimum size of the Auto Scaling group. |
mixed_instances_policy | string | The mixed instances policy for the group. |
new_instances_protected_from_scale_in | boolean | Indicates whether newly launched EC2 instances are protected from termination when scaling in for the Auto Scaling group. For more information about preventing instances from terminating on scale in, see Use instance scale-in protection in the Amazon EC2 Auto Scaling User Guide. |
operator | string | The entity that manages the Auto Scaling group, if applicable. When set, only the designated operator can make changes to the group configuration. |
placement_group | string | The name of the placement group into which to launch EC2 instances for the Auto Scaling group. |
predicted_capacity | integer | The predicted capacity of the group when it has a predictive scaling policy. |
service_linked_role_arn | string | The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon Web Services on your behalf. |
status | string | The current state of the Auto Scaling group when the DeleteAutoScalingGroup operation is in progress. |
suspended_processes | string | The suspended processes associated with the Auto Scaling group. |
tags | string | The tags for the Auto Scaling group. |
target_group_arns | string | The Amazon Resource Names (ARN) of the target groups for your load balancer. |
termination_policies | string | The termination policies for the Auto Scaling group. |
traffic_sources | string | The traffic sources associated with this Auto Scaling group. |
vpc_zone_identifier | string | One or more comma-separated subnet IDs for the Auto Scaling group. |
warm_pool_configuration | string | The warm pool for the group. |
warm_pool_size | integer | The current size of the warm pool. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_auto_scaling_groups | select | region | AutoScalingGroupNames, IncludeInstances, NextToken, MaxRecords, Filters | Gets information about the Auto Scaling groups in the account and Region. If you specify Auto Scaling group names, the output includes information for only the specified Auto Scaling groups. If you specify filters, the output includes information for only those Auto Scaling groups that meet the filter criteria. If you do not specify group names or filters, the output includes information for all Auto Scaling groups. This operation also returns information about instances in Auto Scaling groups. To retrieve information about the instances in a warm pool, you must call the DescribeWarmPool API. |
create_auto_scaling_group | insert | AutoScalingGroupName, MinSize, MaxSize, region | LaunchConfigurationName, LaunchTemplate, MixedInstancesPolicy, InstanceId, DesiredCapacity, DefaultCooldown, AvailabilityZones, AvailabilityZoneIds, LoadBalancerNames, TargetGroupARNs, HealthCheckType, HealthCheckGracePeriod, PlacementGroup, VPCZoneIdentifier, TerminationPolicies, NewInstancesProtectedFromScaleIn, CapacityRebalance, LifecycleHookSpecificationList, DeletionProtection, Tags, ServiceLinkedRoleARN, MaxInstanceLifetime, Context, DesiredCapacityType, DefaultInstanceWarmup, TrafficSources, InstanceMaintenancePolicy, AvailabilityZoneDistribution, AvailabilityZoneImpairmentPolicy, SkipZonalShiftValidation, CapacityReservationSpecification, InstanceLifecyclePolicy, Operator | We strongly recommend using a launch template when calling this operation to ensure full functionality for Amazon EC2 Auto Scaling and Amazon EC2. Creates an Auto Scaling group with the specified name and attributes. If you exceed your maximum limit of Auto Scaling groups, the call fails. To query this limit, call the DescribeAccountLimits API. For information about updating this limit, see Quotas for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. If you're new to Amazon EC2 Auto Scaling, see the introductory tutorials in Get started with Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. Every Auto Scaling group has three size properties (DesiredCapacity, MaxSize, and MinSize). Usually, you set these sizes based on a specific number of instances. However, if you configure a mixed instances policy that defines weights for the instance types, you must specify these sizes with the same units that you use for weighting instances. |
set_instance_protection | update | InstanceIds, AutoScalingGroupName, ProtectedFromScaleIn, region | Updates the instance protection settings of the specified instances. This operation cannot be called on instances in a warm pool. For more information, see Use instance scale-in protection in the Amazon EC2 Auto Scaling User Guide. If you exceed your maximum limit of instance IDs, which is 50 per Auto Scaling group, the call fails. | |
detach_instances | update | AutoScalingGroupName, ShouldDecrementDesiredCapacity, region | InstanceIds | Removes one or more instances from the specified Auto Scaling group. After the instances are detached, you can manage them independent of the Auto Scaling group. If you do not specify the option to decrement the desired capacity, Amazon EC2 Auto Scaling launches instances to replace the ones that are detached. If there is a Classic Load Balancer attached to the Auto Scaling group, the instances are deregistered from the load balancer. If there are target groups attached to the Auto Scaling group, the instances are deregistered from the target groups. For more information, see Detach or attach instances in the Amazon EC2 Auto Scaling User Guide. |
set_desired_capacity | update | AutoScalingGroupName, DesiredCapacity, region | HonorCooldown | Sets the size of the specified Auto Scaling group. If a scale-in activity occurs as a result of a new DesiredCapacity value that is lower than the current size of the group, the Auto Scaling group uses its termination policy to determine which instances to terminate. For more information, see Manual scaling in the Amazon EC2 Auto Scaling User Guide. |
update_auto_scaling_group | update | AutoScalingGroupName, region | LaunchConfigurationName, LaunchTemplate, MixedInstancesPolicy, MinSize, MaxSize, DesiredCapacity, DefaultCooldown, AvailabilityZones, AvailabilityZoneIds, HealthCheckType, HealthCheckGracePeriod, PlacementGroup, VPCZoneIdentifier, TerminationPolicies, NewInstancesProtectedFromScaleIn, ServiceLinkedRoleARN, MaxInstanceLifetime, CapacityRebalance, Context, DesiredCapacityType, DefaultInstanceWarmup, InstanceMaintenancePolicy, AvailabilityZoneDistribution, AvailabilityZoneImpairmentPolicy, SkipZonalShiftValidation, CapacityReservationSpecification, InstanceLifecyclePolicy, DeletionProtection | We strongly recommend that all Auto Scaling groups use launch templates to ensure full functionality for Amazon EC2 Auto Scaling and Amazon EC2. Updates the configuration for the specified Auto Scaling group. To update an Auto Scaling group, specify the name of the group and the property that you want to change. Any properties that you don't specify are not changed by this update request. The new settings take effect on any scaling activities after this call returns. If you associate a new launch configuration or template with an Auto Scaling group, all new instances will get the updated configuration. Existing instances continue to run with the configuration that they were originally launched with. When you update a group to specify a mixed instances policy instead of a launch configuration or template, existing instances may be replaced to match the new purchasing options that you specified in the policy. For example, if the group currently has 100% On-Demand capacity and the policy specifies 50% Spot capacity, this means that half of your instances will be gradually terminated and relaunched as Spot Instances. When replacing instances, Amazon EC2 Auto Scaling launches new instances before terminating the old ones, so that updating your group does not compromise the performance or availability of your application. Note the following about changing DesiredCapacity, MaxSize, or MinSize: If a scale-in activity occurs as a result of a new DesiredCapacity value that is lower than the current size of the group, the Auto Scaling group uses its termination policy to determine which instances to terminate. If you specify a new value for MinSize without specifying a value for DesiredCapacity, and the new MinSize is larger than the current size of the group, this sets the group's DesiredCapacity to the new MinSize value. If you specify a new value for MaxSize without specifying a value for DesiredCapacity, and the new MaxSize is smaller than the current size of the group, this sets the group's DesiredCapacity to the new MaxSize value. To see which properties have been set, call the DescribeAutoScalingGroups API. To view the scaling policies for an Auto Scaling group, call the DescribePolicies API. If the group has scaling policies, you can update them by calling the PutScalingPolicy API. |
put_scheduled_update_group_action | replace | AutoScalingGroupName, ScheduledActionName, region | Time, StartTime, EndTime, Recurrence, MinSize, MaxSize, DesiredCapacity, TimeZone | Creates or updates a scheduled scaling action for an Auto Scaling group. For more information, see Scheduled scaling in the Amazon EC2 Auto Scaling User Guide. You can view the scheduled actions for an Auto Scaling group using the DescribeScheduledActions API call. If you are no longer using a scheduled action, you can delete it by calling the DeleteScheduledAction API. If you try to schedule your action in the past, Amazon EC2 Auto Scaling returns an error message. |
delete_auto_scaling_group | delete | AutoScalingGroupName, region | ForceDelete | Deletes the specified Auto Scaling group. If the group has instances or scaling activities in progress, you must specify the option to force the deletion in order for it to succeed. The force delete operation will also terminate the EC2 instances. If the group has a warm pool, the force delete option also deletes the warm pool. To remove instances from the Auto Scaling group before deleting it, call the DetachInstances API with the list of instances and the option to decrement the desired capacity. This ensures that Amazon EC2 Auto Scaling does not launch replacement instances. To terminate all instances before deleting the Auto Scaling group, call the UpdateAutoScalingGroup API and set the minimum size and desired capacity of the Auto Scaling group to zero. If the group has scaling policies, deleting the group deletes the policies, the underlying alarm actions, and any alarm that no longer has an associated action. For more information, see Delete your Auto Scaling infrastructure in the Amazon EC2 Auto Scaling User Guide. |
terminate_instance_in_auto_scaling_group | delete | ShouldDecrementDesiredCapacity, region | InstanceId, InstanceIds, AutoScalingGroupName | Terminates the specified instance and optionally adjusts the desired group size. This operation cannot be called on instances in a warm pool. This call simply makes a termination request. The instances are not terminated immediately. When an instance is terminated, the instance status changes to terminated. You can't connect to or start an instance after you've terminated it. If you do not specify the option to decrement the desired capacity, Amazon EC2 Auto Scaling launches instances to replace the ones that are terminated. To terminate multiple instances in a single call, use the InstanceIds and AutoScalingGroupName parameters instead of InstanceId. When terminating multiple instances, the response populates Activities instead of Activity. By default, Amazon EC2 Auto Scaling balances instances across all Availability Zones. If you decrement the desired capacity, your Auto Scaling group can become unbalanced between Availability Zones. Amazon EC2 Auto Scaling tries to rebalance the group, and rebalancing might terminate instances in other zones. For more information, see Manual scaling in the Amazon EC2 Auto Scaling User Guide. |
attach_instances | exec | AutoScalingGroupName, region | InstanceIds | Attaches one or more EC2 instances to the specified Auto Scaling group. When you attach instances, Amazon EC2 Auto Scaling increases the desired capacity of the group by the number of instances being attached. If the number of instances being attached plus the desired capacity of the group exceeds the maximum size of the group, the operation fails. If there is a Classic Load Balancer attached to your Auto Scaling group, the instances are also registered with the load balancer. If there are target groups attached to your Auto Scaling group, the instances are also registered with the target groups. For more information, see Detach or attach instances in the Amazon EC2 Auto Scaling User Guide. |
batch_delete_scheduled_action | exec | AutoScalingGroupName, ScheduledActionNames, region | Deletes one or more scheduled actions for the specified Auto Scaling group. | |
batch_put_scheduled_update_group_action | exec | AutoScalingGroupName, ScheduledUpdateGroupActions, region | Creates or updates one or more scheduled scaling actions for an Auto Scaling group. | |
cancel_instance_refresh | exec | AutoScalingGroupName, region | WaitForTransitioningInstances | Cancels an instance refresh or rollback that is in progress. If an instance refresh or rollback is not in progress, an ActiveInstanceRefreshNotFound error occurs. This operation is part of the instance refresh feature in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group after you make configuration changes. When you cancel an instance refresh, this does not roll back any changes that it made. Use the RollbackInstanceRefresh API to roll back instead. |
complete_lifecycle_action | exec | LifecycleHookName, AutoScalingGroupName, LifecycleActionResult, region | LifecycleActionToken, InstanceId | Completes the lifecycle action for the specified token or instance with the specified result. This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group: (Optional) Create a launch template or launch configuration with a user data script that runs while an instance is in a wait state due to a lifecycle hook. (Optional) Create a Lambda function and a rule that allows Amazon EventBridge to invoke your Lambda function when an instance is put into a wait state due to a lifecycle hook. (Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon EC2 Auto Scaling to publish lifecycle notifications to the target. Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate. If you need more time, record the lifecycle action heartbeat to keep the instance in a wait state. If you finish before the timeout period ends, send a callback by using the CompleteLifecycleAction API call. For more information, see Complete a lifecycle action in the Amazon EC2 Auto Scaling User Guide. |
disable_metrics_collection | exec | AutoScalingGroupName, region | Metrics | Disables group metrics collection for the specified Auto Scaling group. |
enable_metrics_collection | exec | AutoScalingGroupName, Granularity, region | Metrics | Enables group metrics collection for the specified Auto Scaling group. You can use these metrics to track changes in an Auto Scaling group and to set alarms on threshold values. You can view group metrics using the Amazon EC2 Auto Scaling console or the CloudWatch console. For more information, see Monitor CloudWatch metrics for your Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide. |
enter_standby | exec | AutoScalingGroupName, ShouldDecrementDesiredCapacity, region | InstanceIds | Moves the specified instances into the standby state. If you choose to decrement the desired capacity of the Auto Scaling group, the instances can enter standby as long as the desired capacity of the Auto Scaling group after the instances are placed into standby is equal to or greater than the minimum capacity of the group. If you choose not to decrement the desired capacity of the Auto Scaling group, the Auto Scaling group launches new instances to replace the instances on standby. For more information, see Temporarily removing instances from your Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. |
exit_standby | exec | AutoScalingGroupName, region | InstanceIds | Moves the specified instances out of the standby state. After you put the instances back in service, the desired capacity is incremented. For more information, see Temporarily removing instances from your Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. |
launch_instances | exec | AutoScalingGroupName, RequestedCapacity, ClientToken, region | AvailabilityZones, AvailabilityZoneIds, SubnetIds, RetryStrategy | Launches a specified number of instances in an Auto Scaling group. Returns instance IDs and other details if launch is successful or error details if launch is unsuccessful. |
record_lifecycle_action_heartbeat | exec | LifecycleHookName, AutoScalingGroupName, region | LifecycleActionToken, InstanceId | Records a heartbeat for the lifecycle action associated with the specified token or instance. This extends the timeout by the length of time defined using the PutLifecycleHook API call. This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group: (Optional) Create a launch template or launch configuration with a user data script that runs while an instance is in a wait state due to a lifecycle hook. (Optional) Create a Lambda function and a rule that allows Amazon EventBridge to invoke your Lambda function when an instance is put into a wait state due to a lifecycle hook. (Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon EC2 Auto Scaling to publish lifecycle notifications to the target. Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate. If you need more time, record the lifecycle action heartbeat to keep the instance in a wait state. If you finish before the timeout period ends, send a callback by using the CompleteLifecycleAction API call. For more information, see Amazon EC2 Auto Scaling lifecycle hooks in the Amazon EC2 Auto Scaling User Guide. |
resume_processes | exec | AutoScalingGroupName, region | ScalingProcesses | Resumes the specified suspended auto scaling processes, or all suspended process, for the specified Auto Scaling group. For more information, see Suspend and resume Amazon EC2 Auto Scaling processes in the Amazon EC2 Auto Scaling User Guide. |
rollback_instance_refresh | exec | AutoScalingGroupName, region | Cancels an instance refresh that is in progress and rolls back any changes that it made. Amazon EC2 Auto Scaling replaces any instances that were replaced during the instance refresh. This restores your Auto Scaling group to the configuration that it was using before the start of the instance refresh. This operation is part of the instance refresh feature in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group after you make configuration changes. A rollback is not supported in the following situations: There is no desired configuration specified for the instance refresh. The Auto Scaling group has a launch template that uses an Amazon Web Services Systems Manager parameter instead of an AMI ID for the ImageId property. The Auto Scaling group uses the launch template's $Latest or $Default version. When you receive a successful response from this operation, Amazon EC2 Auto Scaling immediately begins replacing instances. You can check the status of this operation through the DescribeInstanceRefreshes API operation. | |
start_instance_refresh | exec | AutoScalingGroupName, region | Strategy, DesiredConfiguration, Preferences | Starts an instance refresh. This operation is part of the instance refresh feature in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group. This feature is helpful, for example, when you have a new AMI or a new user data script. You just need to create a new launch template that specifies the new AMI or user data script. Then start an instance refresh to immediately begin the process of updating instances in the group. If successful, the request's response contains a unique ID that you can use to track the progress of the instance refresh. To query its status, call the DescribeInstanceRefreshes API. To describe the instance refreshes that have already run, call the DescribeInstanceRefreshes API. To cancel an instance refresh that is in progress, use the CancelInstanceRefresh API. An instance refresh might fail for several reasons, such as EC2 launch failures, misconfigured health checks, or not ignoring or allowing the termination of instances that are in Standby state or protected from scale in. You can monitor for failed EC2 launches using the scaling activities. To find the scaling activities, call the DescribeScalingActivities API. If you enable auto rollback, your Auto Scaling group will be rolled back automatically when the instance refresh fails. You can enable this feature before starting an instance refresh by specifying the AutoRollback property in the instance refresh preferences. Otherwise, to roll back an instance refresh before it finishes, use the RollbackInstanceRefresh API. |
suspend_processes | exec | AutoScalingGroupName, region | ScalingProcesses | Suspends the specified auto scaling processes, or all processes, for the specified Auto Scaling group. If you suspend either the Launch or Terminate process types, it can prevent other process types from functioning properly. For more information, see Suspend and resume Amazon EC2 Auto Scaling processes in the Amazon EC2 Auto Scaling User Guide. To resume processes that have been suspended, call the ResumeProcesses API. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
AutoScalingGroupName | string | The name of the Auto Scaling group. |
ClientToken | string | A unique, case-sensitive identifier to ensure idempotency of the request. |
DesiredCapacity | integer | The desired capacity is the initial capacity of the Auto Scaling group after this operation completes and the capacity it attempts to maintain. |
Granularity | string | The frequency at which Amazon EC2 Auto Scaling sends aggregated data to CloudWatch. The only valid value is 1Minute. |
InstanceIds | array | One or more instance IDs. You can specify up to 50 instances. |
LifecycleActionResult | string | The action for the group to take. You can specify either CONTINUE or ABANDON. |
LifecycleHookName | string | The name of the lifecycle hook. |
MaxSize | integer | The maximum size of the group. With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above MaxSize to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go above MaxSize by more than your largest instance weight (weights that define how many units each instance contributes to the desired capacity of the group). |
MinSize | integer | The minimum size of the group. |
ProtectedFromScaleIn | boolean | Indicates whether the instance is protected from termination by Amazon EC2 Auto Scaling when scaling in. |
RequestedCapacity | integer | The number of instances to launch. Although this value can exceed 100 for instance weights, the actual instance count is limited to 100 instances per launch. |
ScheduledActionName | string | The name of this scaling action. |
ScheduledActionNames | array | The names of the scheduled actions to delete. The maximum number allowed is 50. |
ScheduledUpdateGroupActions | array | One or more scheduled actions. The maximum number allowed is 50. |
ShouldDecrementDesiredCapacity | boolean | Indicates whether to decrement the desired capacity of the Auto Scaling group by the number of instances moved to Standby mode. |
region | string | AWS region (default: us-east-1) |
AutoScalingGroupName | string | The name of the Auto Scaling group. Required when using InstanceIds. |
AutoScalingGroupNames | array | The names of the Auto Scaling groups. By default, you can only specify up to 50 names. You can optionally increase this limit using the MaxRecords property. If you omit this property, all Auto Scaling groups are described. |
AvailabilityZoneDistribution | object | The instance capacity distribution across Availability Zones. |
AvailabilityZoneIds | array | A list of Availability Zone IDs where instances should be launched. Must match or be included in the group's AZ configuration. You cannot specify both AvailabilityZones and AvailabilityZoneIds. Required for multi-AZ groups, optional for single-AZ groups. |
AvailabilityZoneImpairmentPolicy | object | The policy for Availability Zone impairment. |
AvailabilityZones | array | The Availability Zones for the instance launch. Must match or be included in the Auto Scaling group's Availability Zone configuration. Either AvailabilityZones or SubnetIds must be specified for groups with multiple Availability Zone configurations. |
CapacityRebalance | boolean | Enables or disables Capacity Rebalancing. If Capacity Rebalancing is disabled, proactive replacement of at-risk Spot Instances does not occur. For more information, see Capacity Rebalancing in Auto Scaling to replace at-risk Spot Instances in the Amazon EC2 Auto Scaling User Guide. To suspend rebalancing across Availability Zones, use the SuspendProcesses API. |
CapacityReservationSpecification | object | The capacity reservation specification for the Auto Scaling group. |
Context | string | Reserved. |
DefaultCooldown | integer | Only needed if you use simple scaling policies. The amount of time, in seconds, between one scaling activity ending and another one starting due to simple scaling policies. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. |
DefaultInstanceWarmup | integer | The amount of time, in seconds, until a new instance is considered to have finished initializing and resource consumption to become stable after it enters the InService state. During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that are used for scaling, resulting in more reliable usage data. For more information, see Set the default instance warmup for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. To manage various warm-up settings at the group level, we recommend that you set the default instance warmup, even if it is set to 0 seconds. To remove a value that you previously set, include the property but specify -1 for the value. However, we strongly recommend keeping the default instance warmup enabled by specifying a value of 0 or other nominal value. |
DeletionProtection | string | The deletion protection setting for the Auto Scaling group. This setting helps safeguard your Auto Scaling group and its instances by controlling whether the DeleteAutoScalingGroup operation is allowed. When deletion protection is enabled, users cannot delete the Auto Scaling group according to the specified protection level until the setting is changed back to a less restrictive level. The valid values are none, prevent-force-deletion, and prevent-all-deletion. Default: none For more information, see Configure deletion protection for your Amazon EC2 Auto Scaling resources in the Amazon EC2 Auto Scaling User Guide. |
DesiredCapacity | integer | The desired capacity is the initial capacity of the Auto Scaling group after the scheduled action runs and the capacity it attempts to maintain. It can scale beyond this capacity if you add more scaling conditions. You must specify at least one of the following properties: MaxSize, MinSize, or DesiredCapacity. |
DesiredCapacityType | string | The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports DesiredCapacityType for attribute-based instance type selection only. For more information, see Create a mixed instances group using attribute-based instance type selection in the Amazon EC2 Auto Scaling User Guide. By default, Amazon EC2 Auto Scaling specifies units, which translates into number of instances. Valid values: units | vcpu | memory-mib |
DesiredConfiguration | object | The desired configuration. For example, the desired configuration can specify a new launch template or a new version of the current launch template. Once the instance refresh succeeds, Amazon EC2 Auto Scaling updates the settings of the Auto Scaling group to reflect the new desired configuration. When you specify a new launch template or a new version of the current launch template for your desired configuration, consider enabling the SkipMatching property in preferences. If it's enabled, Amazon EC2 Auto Scaling skips replacing instances that already use the specified launch template and instance types. This can help you reduce the number of replacements that are required to apply updates. |
EndTime | string (date-time) | The date and time for the recurring schedule to end, in UTC. For example, "2021-06-01T00:00:00Z". |
Filters | array | One or more filters to limit the results based on specific tags. |
ForceDelete | boolean | Specifies that the group is to be deleted along with all instances associated with the group, without waiting for all instances to be terminated. This action also deletes any outstanding lifecycle actions associated with the group. |
HealthCheckGracePeriod | integer | The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service and marking it unhealthy due to a failed health check. This is useful if your instances do not immediately pass their health checks after they enter the InService state. For more information, see Set the health check grace period for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. |
HealthCheckType | string | A comma-separated value string of one or more health check types. The valid values are EC2, EBS, ELB, and VPC_LATTICE. EC2 is the default health check and cannot be disabled. For more information, see Health checks for instances in an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. Only specify EC2 if you must clear a value that was previously set. |
HonorCooldown | boolean | Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to complete before initiating a scaling activity to set your Auto Scaling group to its new capacity. By default, Amazon EC2 Auto Scaling does not honor the cooldown period during manual scaling activities. |
IncludeInstances | boolean | Specifies whether to include information about Amazon EC2 instances in the response. When set to true (default), the response includes instance details. |
InstanceId | string | The ID of the instance. |
InstanceIds | array | The IDs of the instances. You can specify up to 20 instances. |
InstanceLifecyclePolicy | object | The instance lifecycle policy for the Auto Scaling group. This policy controls instance behavior when an instance transitions through its lifecycle states. Configure retention triggers to specify when instances should move to a Retained state instead of automatic termination. For more information, see Control instance retention with instance lifecycle policies in the Amazon EC2 Auto Scaling User Guide. |
InstanceMaintenancePolicy | object | An instance maintenance policy. For more information, see Set instance maintenance policy in the Amazon EC2 Auto Scaling User Guide. |
LaunchConfigurationName | string | The name of the launch configuration. If you specify LaunchConfigurationName in your update request, you can't specify LaunchTemplate or MixedInstancesPolicy. |
LaunchTemplate | object | The launch template and version to use to specify the updates. If you specify LaunchTemplate in your update request, you can't specify LaunchConfigurationName or MixedInstancesPolicy. |
LifecycleActionToken | string | A token that uniquely identifies a specific lifecycle action associated with an instance. Amazon EC2 Auto Scaling sends this token to the notification target that you specified when you created the lifecycle hook. |
LifecycleHookSpecificationList | array | One or more lifecycle hooks to add to the Auto Scaling group before instances are launched. |
LoadBalancerNames | array | A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs property instead. |
MaxInstanceLifetime | integer | The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). To clear a previously set value, specify a new value of 0. For more information, see Replacing Auto Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide. |
MaxRecords | integer | The maximum number of items to return with this call. The default value is 50 and the maximum value is 100. |
MaxSize | integer | The maximum size of the Auto Scaling group. |
Metrics | array | Identifies the metrics to enable. You can specify one or more of the following metrics: GroupMinSize GroupMaxSize GroupDesiredCapacity GroupInServiceInstances GroupPendingInstances GroupStandbyInstances GroupTerminatingInstances GroupTotalInstances GroupInServiceCapacity GroupPendingCapacity GroupStandbyCapacity GroupTerminatingCapacity GroupTotalCapacity WarmPoolDesiredCapacity WarmPoolWarmedCapacity WarmPoolPendingCapacity WarmPoolTerminatingCapacity WarmPoolTotalCapacity GroupAndWarmPoolDesiredCapacity GroupAndWarmPoolTotalCapacity If you specify Granularity and don't specify any metrics, all metrics are enabled. For more information, see Amazon CloudWatch metrics for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. |
MinSize | integer | The minimum size of the Auto Scaling group. |
MixedInstancesPolicy | object | The mixed instances policy. For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide. |
NewInstancesProtectedFromScaleIn | boolean | Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. For more information about preventing instances from terminating on scale in, see Use instance scale-in protection in the Amazon EC2 Auto Scaling User Guide. |
NextToken | string | The token for the next set of items to return. (You received this token from a previous call.) |
Operator | object | The entity that manages the Auto Scaling group. If you specify this parameter, Amazon EC2 Auto Scaling passes the operator identity to EC2 for instance launches and only allows the designated operator to make changes to the Auto Scaling group. All mutating API calls from non-operator callers are rejected with an AccessDenied exception. |
PlacementGroup | string | The name of an existing placement group into which to launch your instances. To remove the placement group setting, pass an empty string for placement-group. For more information about placement groups, see Placement groups in the Amazon EC2 User Guide. A cluster placement group is a logical grouping of instances within a single Availability Zone. You cannot specify multiple Availability Zones and a cluster placement group. |
Preferences | object | Sets your preferences for the instance refresh so that it performs as expected when you start it. Includes the instance warmup time, the minimum and maximum healthy percentages, and the behaviors that you want Amazon EC2 Auto Scaling to use if instances that are in Standby state or protected from scale in are found. You can also choose to enable additional features, such as the following: Auto rollback Checkpoints CloudWatch alarms Skip matching Bake time |
Recurrence | string | The recurring schedule for this action. This format consists of five fields separated by white spaces: [Minute] [Hour] [Day_of_Month] [Month_of_Year] [Day_of_Week]. The value must be in quotes (for example, "30 0 1 1,6,12 *"). For more information about this format, see Crontab. When StartTime and EndTime are specified with Recurrence, they form the boundaries of when the recurring action starts and stops. Cron expressions use Universal Coordinated Time (UTC) by default. |
RetryStrategy | string | Specifies whether to retry asynchronously if the synchronous launch fails. Valid values are NONE (default, no async retry) and RETRY_WITH_GROUP_CONFIGURATION (increase desired capacity and retry with group configuration). |
ScalingProcesses | array | One or more of the following processes: Launch Terminate AddToLoadBalancer AlarmNotification AZRebalance HealthCheck InstanceRefresh ReplaceUnhealthy ScheduledActions If you omit this property, all processes are specified. |
ServiceLinkedRoleARN | string | The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon Web Services on your behalf. For more information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide. |
SkipZonalShiftValidation | boolean | If you enable zonal shift with cross-zone disabled load balancers, capacity could become imbalanced across Availability Zones. To skip the validation, specify true. For more information, see Auto Scaling group zonal shift in the Amazon EC2 Auto Scaling User Guide. |
StartTime | string (date-time) | The date and time for this action to start, in YYYY-MM-DDThh:mm:ssZ format in UTC/GMT only and in quotes (for example, "2021-06-01T00:00:00Z"). If you specify Recurrence and StartTime, Amazon EC2 Auto Scaling performs the action at this time, and then performs the action based on the specified recurrence. |
Strategy | string | The strategy to use for the instance refresh. The default value is Rolling. |
SubnetIds | array | The subnet IDs for the instance launch. Either AvailabilityZones or SubnetIds must be specified. If both are specified, the subnets must reside in the specified Availability Zones. |
Tags | array | One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a launch template but use caution. If the launch template specifies an instance tag with a key that is also specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the value specified by the Auto Scaling group. For more information, see Tag Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide. |
TargetGroupARNs | array | The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto Scaling group. Instances are registered as targets with the target groups. The target groups receive incoming traffic and route requests to one or more registered targets. For more information, see Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. |
TerminationPolicies | array | A policy or a list of policies that are used to select the instances to terminate. The policies are executed in the order that you list them. For more information, see Configure termination policies for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. Valid values: Default | AllocationStrategy | ClosestToNextInstanceHour | NewestInstance | OldestInstance | OldestLaunchConfiguration | OldestLaunchTemplate | arn:aws:lambda:region:account-id:function:my-function:my-alias |
Time | string (date-time) | This property is no longer used. |
TimeZone | string | Specifies the time zone for a cron expression. If a time zone is not provided, UTC is used by default. Valid values are the canonical names of the IANA time zones, derived from the IANA Time Zone Database (such as Etc/GMT+9 or Pacific/Tahiti). For more information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. |
TrafficSources | array | The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as traffic sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load Balancer, Network Load Balancer, and VPC Lattice. |
VPCZoneIdentifier | string | A comma-separated list of subnet IDs for a virtual private cloud (VPC). If you specify VPCZoneIdentifier with AvailabilityZones, the subnets that you specify must reside in those Availability Zones. |
WaitForTransitioningInstances | boolean | When cancelling an instance refresh, this indicates whether to wait for in-flight launches and terminations to complete. The default is true. When set to false, Amazon EC2 Auto Scaling cancels the instance refresh without waiting for any pending launches or terminations to complete. |
SELECT examples
- describe_auto_scaling_groups
Gets information about the Auto Scaling groups in the account and Region. If you specify Auto Scaling group names, the output includes information for only the specified Auto Scaling groups. If you specify filters, the output includes information for only those Auto Scaling groups that meet the filter criteria. If you do not specify group names or filters, the output includes information for all Auto Scaling groups. This operation also returns information about instances in Auto Scaling groups. To retrieve information about the instances in a warm pool, you must call the DescribeWarmPool API.
SELECT
auto_scaling_group_arn,
auto_scaling_group_name,
availability_zone_distribution,
availability_zone_ids,
availability_zone_impairment_policy,
availability_zones,
capacity_rebalance,
capacity_reservation_specification,
context,
created_time,
default_cooldown,
default_instance_warmup,
deletion_protection,
desired_capacity,
desired_capacity_type,
enabled_metrics,
health_check_grace_period,
health_check_type,
instance_lifecycle_policy,
instance_maintenance_policy,
instances,
launch_configuration_name,
launch_template,
load_balancer_names,
max_instance_lifetime,
max_size,
min_size,
mixed_instances_policy,
new_instances_protected_from_scale_in,
operator,
placement_group,
predicted_capacity,
service_linked_role_arn,
status,
suspended_processes,
tags,
target_group_arns,
termination_policies,
traffic_sources,
vpc_zone_identifier,
warm_pool_configuration,
warm_pool_size
FROM aws.autoscaling.auto_scaling_groups
WHERE region = '{{ region }}' -- required
AND AutoScalingGroupNames = '{{ AutoScalingGroupNames }}'
AND IncludeInstances = '{{ IncludeInstances }}'
AND NextToken = '{{ NextToken }}'
AND MaxRecords = '{{ MaxRecords }}'
AND Filters = '{{ Filters }}'
;
INSERT examples
- create_auto_scaling_group
- Manifest
We strongly recommend using a launch template when calling this operation to ensure full functionality for Amazon EC2 Auto Scaling and Amazon EC2. Creates an Auto Scaling group with the specified name and attributes. If you exceed your maximum limit of Auto Scaling groups, the call fails. To query this limit, call the DescribeAccountLimits API. For information about updating this limit, see Quotas for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. If you're new to Amazon EC2 Auto Scaling, see the introductory tutorials in Get started with Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. Every Auto Scaling group has three size properties (DesiredCapacity, MaxSize, and MinSize). Usually, you set these sizes based on a specific number of instances. However, if you configure a mixed instances policy that defines weights for the instance types, you must specify these sizes with the same units that you use for weighting instances.
INSERT INTO aws.autoscaling.auto_scaling_groups (
AutoScalingGroupName,
MinSize,
MaxSize,
region,
LaunchConfigurationName,
LaunchTemplate,
MixedInstancesPolicy,
InstanceId,
DesiredCapacity,
DefaultCooldown,
AvailabilityZones,
AvailabilityZoneIds,
LoadBalancerNames,
TargetGroupARNs,
HealthCheckType,
HealthCheckGracePeriod,
PlacementGroup,
VPCZoneIdentifier,
TerminationPolicies,
NewInstancesProtectedFromScaleIn,
CapacityRebalance,
LifecycleHookSpecificationList,
DeletionProtection,
Tags,
ServiceLinkedRoleARN,
MaxInstanceLifetime,
Context,
DesiredCapacityType,
DefaultInstanceWarmup,
TrafficSources,
InstanceMaintenancePolicy,
AvailabilityZoneDistribution,
AvailabilityZoneImpairmentPolicy,
SkipZonalShiftValidation,
CapacityReservationSpecification,
InstanceLifecyclePolicy,
Operator
)
SELECT
'{{ AutoScalingGroupName }}',
'{{ MinSize }}',
'{{ MaxSize }}',
'{{ region }}',
'{{ LaunchConfigurationName }}',
'{{ LaunchTemplate }}',
'{{ MixedInstancesPolicy }}',
'{{ InstanceId }}',
'{{ DesiredCapacity }}',
'{{ DefaultCooldown }}',
'{{ AvailabilityZones }}',
'{{ AvailabilityZoneIds }}',
'{{ LoadBalancerNames }}',
'{{ TargetGroupARNs }}',
'{{ HealthCheckType }}',
'{{ HealthCheckGracePeriod }}',
'{{ PlacementGroup }}',
'{{ VPCZoneIdentifier }}',
'{{ TerminationPolicies }}',
'{{ NewInstancesProtectedFromScaleIn }}',
'{{ CapacityRebalance }}',
'{{ LifecycleHookSpecificationList }}',
'{{ DeletionProtection }}',
'{{ Tags }}',
'{{ ServiceLinkedRoleARN }}',
'{{ MaxInstanceLifetime }}',
'{{ Context }}',
'{{ DesiredCapacityType }}',
'{{ DefaultInstanceWarmup }}',
'{{ TrafficSources }}',
'{{ InstanceMaintenancePolicy }}',
'{{ AvailabilityZoneDistribution }}',
'{{ AvailabilityZoneImpairmentPolicy }}',
'{{ SkipZonalShiftValidation }}',
'{{ CapacityReservationSpecification }}',
'{{ InstanceLifecyclePolicy }}',
'{{ Operator }}'
;
# Description fields are for documentation purposes
- name: auto_scaling_groups
props:
- name: AutoScalingGroupName
value: "{{ AutoScalingGroupName }}"
description: Required parameter for the auto_scaling_groups resource.
- name: MinSize
value: {{ MinSize }}
description: Required parameter for the auto_scaling_groups resource.
- name: MaxSize
value: {{ MaxSize }}
description: Required parameter for the auto_scaling_groups resource.
- name: region
value: "{{ region }}"
description: Required parameter for the auto_scaling_groups resource.
- name: LaunchConfigurationName
value: "{{ LaunchConfigurationName }}"
description: The name of the launch configuration to use to launch instances. Conditional: You must specify either a launch template (LaunchTemplate or MixedInstancesPolicy) or a launch configuration (LaunchConfigurationName or InstanceId).
description: The name of the launch configuration to use to launch instances. Conditional: You must specify either a launch template (LaunchTemplate or MixedInstancesPolicy) or a launch configuration (LaunchConfigurationName or InstanceId).
- name: LaunchTemplate
value: "{{ LaunchTemplate }}"
description: Information used to specify the launch template and version to use to launch instances. Conditional: You must specify either a launch template (LaunchTemplate or MixedInstancesPolicy) or a launch configuration (LaunchConfigurationName or InstanceId). The launch template that is specified must be configured for use with an Auto Scaling group. For more information, see Create a launch template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
description: Information used to specify the launch template and version to use to launch instances. Conditional: You must specify either a launch template (LaunchTemplate or MixedInstancesPolicy) or a launch configuration (LaunchConfigurationName or InstanceId). The launch template that is specified must be configured for use with an Auto Scaling group. For more information, see Create a launch template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
- name: MixedInstancesPolicy
value: "{{ MixedInstancesPolicy }}"
description: The mixed instances policy. For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide.
description: The mixed instances policy. For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide.
- name: InstanceId
value: "{{ InstanceId }}"
description: The ID of the instance used to base the launch configuration on. If specified, Amazon EC2 Auto Scaling uses the configuration values from the specified instance to create a new launch configuration. To get the instance ID, use the Amazon EC2 DescribeInstances API operation. For more information, see Create an Auto Scaling group using parameters from an existing instance in the Amazon EC2 Auto Scaling User Guide.
description: The ID of the instance used to base the launch configuration on. If specified, Amazon EC2 Auto Scaling uses the configuration values from the specified instance to create a new launch configuration. To get the instance ID, use the Amazon EC2 DescribeInstances API operation. For more information, see Create an Auto Scaling group using parameters from an existing instance in the Amazon EC2 Auto Scaling User Guide.
- name: DesiredCapacity
value: {{ DesiredCapacity }}
description: The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the capacity it attempts to maintain. It can scale beyond this capacity if you configure auto scaling. This number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group. If you do not specify a desired capacity, the default is the minimum size of the group.
description: The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the capacity it attempts to maintain. It can scale beyond this capacity if you configure auto scaling. This number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group. If you do not specify a desired capacity, the default is the minimum size of the group.
- name: DefaultCooldown
value: {{ DefaultCooldown }}
description: Only needed if you use simple scaling policies. The amount of time, in seconds, between one scaling activity ending and another one starting due to simple scaling policies. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. Default: 300 seconds
description: Only needed if you use simple scaling policies. The amount of time, in seconds, between one scaling activity ending and another one starting due to simple scaling policies. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. Default: 300 seconds
- name: AvailabilityZones
value: "{{ AvailabilityZones }}"
description: A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into the default VPC subnet in each Availability Zone when not using the VPCZoneIdentifier property, or for attaching a network interface when an existing network interface ID is specified in a launch template.
description: A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into the default VPC subnet in each Availability Zone when not using the VPCZoneIdentifier property, or for attaching a network interface when an existing network interface ID is specified in a launch template.
- name: AvailabilityZoneIds
value: "{{ AvailabilityZoneIds }}"
description: A list of Availability Zone IDs where the Auto Scaling group can launch instances. You cannot specify both AvailabilityZones and AvailabilityZoneIds in the same request.
description: A list of Availability Zone IDs where the Auto Scaling group can launch instances. You cannot specify both AvailabilityZones and AvailabilityZoneIds in the same request.
- name: LoadBalancerNames
value: "{{ LoadBalancerNames }}"
description: A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs property instead.
description: A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs property instead.
- name: TargetGroupARNs
value: "{{ TargetGroupARNs }}"
description: The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto Scaling group. Instances are registered as targets with the target groups. The target groups receive incoming traffic and route requests to one or more registered targets. For more information, see Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
description: The Amazon Resource Names (ARN) of the Elastic Load Balancing target groups to associate with the Auto Scaling group. Instances are registered as targets with the target groups. The target groups receive incoming traffic and route requests to one or more registered targets. For more information, see Use Elastic Load Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
- name: HealthCheckType
value: "{{ HealthCheckType }}"
description: A comma-separated value string of one or more health check types. The valid values are EC2, EBS, ELB, and VPC_LATTICE. EC2 is the default health check and cannot be disabled. For more information, see Health checks for instances in an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. Only specify EC2 if you must clear a value that was previously set.
description: A comma-separated value string of one or more health check types. The valid values are EC2, EBS, ELB, and VPC_LATTICE. EC2 is the default health check and cannot be disabled. For more information, see Health checks for instances in an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. Only specify EC2 if you must clear a value that was previously set.
- name: HealthCheckGracePeriod
value: {{ HealthCheckGracePeriod }}
description: The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service and marking it unhealthy due to a failed health check. This is useful if your instances do not immediately pass their health checks after they enter the InService state. For more information, see Set the health check grace period for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. Default: 0 seconds
description: The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service and marking it unhealthy due to a failed health check. This is useful if your instances do not immediately pass their health checks after they enter the InService state. For more information, see Set the health check grace period for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. Default: 0 seconds
- name: PlacementGroup
value: "{{ PlacementGroup }}"
description: The name of the placement group into which to launch your instances. For more information, see Placement groups in the Amazon EC2 User Guide. A cluster placement group is a logical grouping of instances within a single Availability Zone. You cannot specify multiple Availability Zones and a cluster placement group.
description: The name of the placement group into which to launch your instances. For more information, see Placement groups in the Amazon EC2 User Guide. A cluster placement group is a logical grouping of instances within a single Availability Zone. You cannot specify multiple Availability Zones and a cluster placement group.
- name: VPCZoneIdentifier
value: "{{ VPCZoneIdentifier }}"
description: A comma-separated list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group can be created. If you specify VPCZoneIdentifier with AvailabilityZones, the subnets that you specify must reside in those Availability Zones.
description: A comma-separated list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group can be created. If you specify VPCZoneIdentifier with AvailabilityZones, the subnets that you specify must reside in those Availability Zones.
- name: TerminationPolicies
value: "{{ TerminationPolicies }}"
description: A policy or a list of policies that are used to select the instance to terminate. These policies are executed in the order that you list them. For more information, see Configure termination policies for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. Valid values: Default | AllocationStrategy | ClosestToNextInstanceHour | NewestInstance | OldestInstance | OldestLaunchConfiguration | OldestLaunchTemplate | arn:aws:lambda:region:account-id:function:my-function:my-alias
description: A policy or a list of policies that are used to select the instance to terminate. These policies are executed in the order that you list them. For more information, see Configure termination policies for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. Valid values: Default | AllocationStrategy | ClosestToNextInstanceHour | NewestInstance | OldestInstance | OldestLaunchConfiguration | OldestLaunchTemplate | arn:aws:lambda:region:account-id:function:my-function:my-alias
- name: NewInstancesProtectedFromScaleIn
value: {{ NewInstancesProtectedFromScaleIn }}
description: Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. For more information about preventing instances from terminating on scale in, see Use instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.
description: Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. For more information about preventing instances from terminating on scale in, see Use instance scale-in protection in the Amazon EC2 Auto Scaling User Guide.
- name: CapacityRebalance
value: {{ CapacityRebalance }}
description: Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates an old instance. For more information, see Use Capacity Rebalancing to handle Amazon EC2 Spot Interruptions in the in the Amazon EC2 Auto Scaling User Guide.
description: Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates an old instance. For more information, see Use Capacity Rebalancing to handle Amazon EC2 Spot Interruptions in the in the Amazon EC2 Auto Scaling User Guide.
- name: LifecycleHookSpecificationList
value: "{{ LifecycleHookSpecificationList }}"
description: One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.
description: One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.
- name: DeletionProtection
value: "{{ DeletionProtection }}"
description: The deletion protection setting for the Auto Scaling group. This setting helps safeguard your Auto Scaling group and its instances by controlling whether the DeleteAutoScalingGroup operation is allowed. When deletion protection is enabled, users cannot delete the Auto Scaling group according to the specified protection level until the setting is changed back to a less restrictive level. The valid values are none, prevent-force-deletion, and prevent-all-deletion. Default: none For more information, see Configure deletion protection for your Amazon EC2 Auto Scaling resources in the Amazon EC2 Auto Scaling User Guide.
description: The deletion protection setting for the Auto Scaling group. This setting helps safeguard your Auto Scaling group and its instances by controlling whether the DeleteAutoScalingGroup operation is allowed. When deletion protection is enabled, users cannot delete the Auto Scaling group according to the specified protection level until the setting is changed back to a less restrictive level. The valid values are none, prevent-force-deletion, and prevent-all-deletion. Default: none For more information, see Configure deletion protection for your Amazon EC2 Auto Scaling resources in the Amazon EC2 Auto Scaling User Guide.
- name: Tags
value: "{{ Tags }}"
description: One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a launch template but use caution. If the launch template specifies an instance tag with a key that is also specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the value specified by the Auto Scaling group. For more information, see Tag Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide.
description: One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a launch template but use caution. If the launch template specifies an instance tag with a key that is also specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the value specified by the Auto Scaling group. For more information, see Tag Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide.
- name: ServiceLinkedRoleARN
value: "{{ ServiceLinkedRoleARN }}"
description: The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon Web Services service on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named AWSServiceRoleForAutoScaling, which it creates if it does not exist. For more information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide.
description: The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other Amazon Web Services service on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named AWSServiceRoleForAutoScaling, which it creates if it does not exist. For more information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide.
- name: MaxInstanceLifetime
value: {{ MaxInstanceLifetime }}
description: The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see Replace Auto Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide.
description: The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see Replace Auto Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide.
- name: Context
value: "{{ Context }}"
description: Reserved.
description: Reserved.
- name: DesiredCapacityType
value: "{{ DesiredCapacityType }}"
description: The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports DesiredCapacityType for attribute-based instance type selection only. For more information, see Create a mixed instances group using attribute-based instance type selection in the Amazon EC2 Auto Scaling User Guide. By default, Amazon EC2 Auto Scaling specifies units, which translates into number of instances. Valid values: units | vcpu | memory-mib
description: The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports DesiredCapacityType for attribute-based instance type selection only. For more information, see Create a mixed instances group using attribute-based instance type selection in the Amazon EC2 Auto Scaling User Guide. By default, Amazon EC2 Auto Scaling specifies units, which translates into number of instances. Valid values: units | vcpu | memory-mib
- name: DefaultInstanceWarmup
value: {{ DefaultInstanceWarmup }}
description: The amount of time, in seconds, until a new instance is considered to have finished initializing and resource consumption to become stable after it enters the InService state. During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that are used for scaling, resulting in more reliable usage data. For more information, see Set the default instance warmup for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. To manage various warm-up settings at the group level, we recommend that you set the default instance warmup, even if it is set to 0 seconds. To remove a value that you previously set, include the property but specify -1 for the value. However, we strongly recommend keeping the default instance warmup enabled by specifying a value of 0 or other nominal value. Default: None
description: The amount of time, in seconds, until a new instance is considered to have finished initializing and resource consumption to become stable after it enters the InService state. During an instance refresh, Amazon EC2 Auto Scaling waits for the warm-up period after it replaces an instance before it moves on to replacing the next instance. Amazon EC2 Auto Scaling also waits for the warm-up period before aggregating the metrics for new instances with existing instances in the Amazon CloudWatch metrics that are used for scaling, resulting in more reliable usage data. For more information, see Set the default instance warmup for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. To manage various warm-up settings at the group level, we recommend that you set the default instance warmup, even if it is set to 0 seconds. To remove a value that you previously set, include the property but specify -1 for the value. However, we strongly recommend keeping the default instance warmup enabled by specifying a value of 0 or other nominal value. Default: None
- name: TrafficSources
value: "{{ TrafficSources }}"
description: The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as traffic sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load Balancer, Network Load Balancer, and VPC Lattice.
description: The list of traffic sources to attach to this Auto Scaling group. You can use any of the following as traffic sources for an Auto Scaling group: Classic Load Balancer, Application Load Balancer, Gateway Load Balancer, Network Load Balancer, and VPC Lattice.
- name: InstanceMaintenancePolicy
value: "{{ InstanceMaintenancePolicy }}"
description: An instance maintenance policy. For more information, see Set instance maintenance policy in the Amazon EC2 Auto Scaling User Guide.
description: An instance maintenance policy. For more information, see Set instance maintenance policy in the Amazon EC2 Auto Scaling User Guide.
- name: AvailabilityZoneDistribution
value: "{{ AvailabilityZoneDistribution }}"
description: The instance capacity distribution across Availability Zones.
description: The instance capacity distribution across Availability Zones.
- name: AvailabilityZoneImpairmentPolicy
value: "{{ AvailabilityZoneImpairmentPolicy }}"
description: The policy for Availability Zone impairment.
description: The policy for Availability Zone impairment.
- name: SkipZonalShiftValidation
value: {{ SkipZonalShiftValidation }}
description: If you enable zonal shift with cross-zone disabled load balancers, capacity could become imbalanced across Availability Zones. To skip the validation, specify true. For more information, see Auto Scaling group zonal shift in the Amazon EC2 Auto Scaling User Guide.
description: If you enable zonal shift with cross-zone disabled load balancers, capacity could become imbalanced across Availability Zones. To skip the validation, specify true. For more information, see Auto Scaling group zonal shift in the Amazon EC2 Auto Scaling User Guide.
- name: CapacityReservationSpecification
value: "{{ CapacityReservationSpecification }}"
description: The capacity reservation specification for the Auto Scaling group.
description: The capacity reservation specification for the Auto Scaling group.
- name: InstanceLifecyclePolicy
value: "{{ InstanceLifecyclePolicy }}"
description: The instance lifecycle policy for the Auto Scaling group. This policy controls instance behavior when an instance transitions through its lifecycle states. Configure retention triggers to specify when instances should move to a Retained state instead of automatic termination. For more information, see Control instance retention with instance lifecycle policies in the Amazon EC2 Auto Scaling User Guide. Instances in a Retained state will continue to incur standard EC2 charges until terminated.
description: The instance lifecycle policy for the Auto Scaling group. This policy controls instance behavior when an instance transitions through its lifecycle states. Configure retention triggers to specify when instances should move to a Retained state instead of automatic termination. For more information, see Control instance retention with instance lifecycle policies in the Amazon EC2 Auto Scaling User Guide. Instances in a Retained state will continue to incur standard EC2 charges until terminated.
- name: Operator
value: "{{ Operator }}"
description: The entity that manages the Auto Scaling group. If you specify this parameter, Amazon EC2 Auto Scaling passes the operator identity to EC2 for instance launches and only allows the designated operator to make changes to the Auto Scaling group. All mutating API calls from non-operator callers are rejected with an AccessDenied exception.
description: The entity that manages the Auto Scaling group. If you specify this parameter, Amazon EC2 Auto Scaling passes the operator identity to EC2 for instance launches and only allows the designated operator to make changes to the Auto Scaling group. All mutating API calls from non-operator callers are rejected with an AccessDenied exception.
UPDATE examples
- set_instance_protection
- detach_instances
- set_desired_capacity
- update_auto_scaling_group
Updates the instance protection settings of the specified instances. This operation cannot be called on instances in a warm pool. For more information, see Use instance scale-in protection in the Amazon EC2 Auto Scaling User Guide. If you exceed your maximum limit of instance IDs, which is 50 per Auto Scaling group, the call fails.
UPDATE aws.autoscaling.auto_scaling_groups
SET
-- No updatable properties
WHERE
InstanceIds = '{{ InstanceIds }}' --required
AND AutoScalingGroupName = '{{ AutoScalingGroupName }}' --required
AND ProtectedFromScaleIn = '{{ ProtectedFromScaleIn }}' --required
AND region = '{{ region }}' --required;
Removes one or more instances from the specified Auto Scaling group. After the instances are detached, you can manage them independent of the Auto Scaling group. If you do not specify the option to decrement the desired capacity, Amazon EC2 Auto Scaling launches instances to replace the ones that are detached. If there is a Classic Load Balancer attached to the Auto Scaling group, the instances are deregistered from the load balancer. If there are target groups attached to the Auto Scaling group, the instances are deregistered from the target groups. For more information, see Detach or attach instances in the Amazon EC2 Auto Scaling User Guide.
UPDATE aws.autoscaling.auto_scaling_groups
SET
-- No updatable properties
WHERE
AutoScalingGroupName = '{{ AutoScalingGroupName }}' --required
AND ShouldDecrementDesiredCapacity = '{{ ShouldDecrementDesiredCapacity }}' --required
AND region = '{{ region }}' --required
AND InstanceIds = '{{ InstanceIds}}'
RETURNING
activities;
Sets the size of the specified Auto Scaling group. If a scale-in activity occurs as a result of a new DesiredCapacity value that is lower than the current size of the group, the Auto Scaling group uses its termination policy to determine which instances to terminate. For more information, see Manual scaling in the Amazon EC2 Auto Scaling User Guide.
UPDATE aws.autoscaling.auto_scaling_groups
SET
-- No updatable properties
WHERE
AutoScalingGroupName = '{{ AutoScalingGroupName }}' --required
AND DesiredCapacity = '{{ DesiredCapacity }}' --required
AND region = '{{ region }}' --required
AND HonorCooldown = {{ HonorCooldown}};
We strongly recommend that all Auto Scaling groups use launch templates to ensure full functionality for Amazon EC2 Auto Scaling and Amazon EC2. Updates the configuration for the specified Auto Scaling group. To update an Auto Scaling group, specify the name of the group and the property that you want to change. Any properties that you don't specify are not changed by this update request. The new settings take effect on any scaling activities after this call returns. If you associate a new launch configuration or template with an Auto Scaling group, all new instances will get the updated configuration. Existing instances continue to run with the configuration that they were originally launched with. When you update a group to specify a mixed instances policy instead of a launch configuration or template, existing instances may be replaced to match the new purchasing options that you specified in the policy. For example, if the group currently has 100% On-Demand capacity and the policy specifies 50% Spot capacity, this means that half of your instances will be gradually terminated and relaunched as Spot Instances. When replacing instances, Amazon EC2 Auto Scaling launches new instances before terminating the old ones, so that updating your group does not compromise the performance or availability of your application. Note the following about changing DesiredCapacity, MaxSize, or MinSize: If a scale-in activity occurs as a result of a new DesiredCapacity value that is lower than the current size of the group, the Auto Scaling group uses its termination policy to determine which instances to terminate. If you specify a new value for MinSize without specifying a value for DesiredCapacity, and the new MinSize is larger than the current size of the group, this sets the group's DesiredCapacity to the new MinSize value. If you specify a new value for MaxSize without specifying a value for DesiredCapacity, and the new MaxSize is smaller than the current size of the group, this sets the group's DesiredCapacity to the new MaxSize value. To see which properties have been set, call the DescribeAutoScalingGroups API. To view the scaling policies for an Auto Scaling group, call the DescribePolicies API. If the group has scaling policies, you can update them by calling the PutScalingPolicy API.
UPDATE aws.autoscaling.auto_scaling_groups
SET
-- No updatable properties
WHERE
AutoScalingGroupName = '{{ AutoScalingGroupName }}' --required
AND region = '{{ region }}' --required
AND LaunchConfigurationName = '{{ LaunchConfigurationName}}'
AND LaunchTemplate = '{{ LaunchTemplate}}'
AND MixedInstancesPolicy = '{{ MixedInstancesPolicy}}'
AND MinSize = '{{ MinSize}}'
AND MaxSize = '{{ MaxSize}}'
AND DesiredCapacity = '{{ DesiredCapacity}}'
AND DefaultCooldown = '{{ DefaultCooldown}}'
AND AvailabilityZones = '{{ AvailabilityZones}}'
AND AvailabilityZoneIds = '{{ AvailabilityZoneIds}}'
AND HealthCheckType = '{{ HealthCheckType}}'
AND HealthCheckGracePeriod = '{{ HealthCheckGracePeriod}}'
AND PlacementGroup = '{{ PlacementGroup}}'
AND VPCZoneIdentifier = '{{ VPCZoneIdentifier}}'
AND TerminationPolicies = '{{ TerminationPolicies}}'
AND NewInstancesProtectedFromScaleIn = {{ NewInstancesProtectedFromScaleIn}}
AND ServiceLinkedRoleARN = '{{ ServiceLinkedRoleARN}}'
AND MaxInstanceLifetime = '{{ MaxInstanceLifetime}}'
AND CapacityRebalance = {{ CapacityRebalance}}
AND Context = '{{ Context}}'
AND DesiredCapacityType = '{{ DesiredCapacityType}}'
AND DefaultInstanceWarmup = '{{ DefaultInstanceWarmup}}'
AND InstanceMaintenancePolicy = '{{ InstanceMaintenancePolicy}}'
AND AvailabilityZoneDistribution = '{{ AvailabilityZoneDistribution}}'
AND AvailabilityZoneImpairmentPolicy = '{{ AvailabilityZoneImpairmentPolicy}}'
AND SkipZonalShiftValidation = {{ SkipZonalShiftValidation}}
AND CapacityReservationSpecification = '{{ CapacityReservationSpecification}}'
AND InstanceLifecyclePolicy = '{{ InstanceLifecyclePolicy}}'
AND DeletionProtection = '{{ DeletionProtection}}';
REPLACE examples
- put_scheduled_update_group_action
Creates or updates a scheduled scaling action for an Auto Scaling group. For more information, see Scheduled scaling in the Amazon EC2 Auto Scaling User Guide. You can view the scheduled actions for an Auto Scaling group using the DescribeScheduledActions API call. If you are no longer using a scheduled action, you can delete it by calling the DeleteScheduledAction API. If you try to schedule your action in the past, Amazon EC2 Auto Scaling returns an error message.
REPLACE aws.autoscaling.auto_scaling_groups
SET
-- No updatable properties
WHERE
AutoScalingGroupName = '{{ AutoScalingGroupName }}' --required
AND ScheduledActionName = '{{ ScheduledActionName }}' --required
AND region = '{{ region }}' --required
AND Time = '{{ Time}}'
AND StartTime = '{{ StartTime}}'
AND EndTime = '{{ EndTime}}'
AND Recurrence = '{{ Recurrence}}'
AND MinSize = '{{ MinSize}}'
AND MaxSize = '{{ MaxSize}}'
AND DesiredCapacity = '{{ DesiredCapacity}}'
AND TimeZone = '{{ TimeZone}}';
DELETE examples
- delete_auto_scaling_group
- terminate_instance_in_auto_scaling_group
Deletes the specified Auto Scaling group. If the group has instances or scaling activities in progress, you must specify the option to force the deletion in order for it to succeed. The force delete operation will also terminate the EC2 instances. If the group has a warm pool, the force delete option also deletes the warm pool. To remove instances from the Auto Scaling group before deleting it, call the DetachInstances API with the list of instances and the option to decrement the desired capacity. This ensures that Amazon EC2 Auto Scaling does not launch replacement instances. To terminate all instances before deleting the Auto Scaling group, call the UpdateAutoScalingGroup API and set the minimum size and desired capacity of the Auto Scaling group to zero. If the group has scaling policies, deleting the group deletes the policies, the underlying alarm actions, and any alarm that no longer has an associated action. For more information, see Delete your Auto Scaling infrastructure in the Amazon EC2 Auto Scaling User Guide.
DELETE FROM aws.autoscaling.auto_scaling_groups
WHERE AutoScalingGroupName = '{{ AutoScalingGroupName }}' --required
AND region = '{{ region }}' --required
AND ForceDelete = '{{ ForceDelete }}'
;
Terminates the specified instance and optionally adjusts the desired group size. This operation cannot be called on instances in a warm pool. This call simply makes a termination request. The instances are not terminated immediately. When an instance is terminated, the instance status changes to terminated. You can't connect to or start an instance after you've terminated it. If you do not specify the option to decrement the desired capacity, Amazon EC2 Auto Scaling launches instances to replace the ones that are terminated. To terminate multiple instances in a single call, use the InstanceIds and AutoScalingGroupName parameters instead of InstanceId. When terminating multiple instances, the response populates Activities instead of Activity. By default, Amazon EC2 Auto Scaling balances instances across all Availability Zones. If you decrement the desired capacity, your Auto Scaling group can become unbalanced between Availability Zones. Amazon EC2 Auto Scaling tries to rebalance the group, and rebalancing might terminate instances in other zones. For more information, see Manual scaling in the Amazon EC2 Auto Scaling User Guide.
DELETE FROM aws.autoscaling.auto_scaling_groups
WHERE ShouldDecrementDesiredCapacity = '{{ ShouldDecrementDesiredCapacity }}' --required
AND region = '{{ region }}' --required
AND InstanceId = '{{ InstanceId }}'
AND InstanceIds = '{{ InstanceIds }}'
AND AutoScalingGroupName = '{{ AutoScalingGroupName }}'
;
Lifecycle Methods
- attach_instances
- batch_delete_scheduled_action
- batch_put_scheduled_update_group_action
- cancel_instance_refresh
- complete_lifecycle_action
- disable_metrics_collection
- enable_metrics_collection
- enter_standby
- exit_standby
- launch_instances
- record_lifecycle_action_heartbeat
- resume_processes
- rollback_instance_refresh
- start_instance_refresh
- suspend_processes
Attaches one or more EC2 instances to the specified Auto Scaling group. When you attach instances, Amazon EC2 Auto Scaling increases the desired capacity of the group by the number of instances being attached. If the number of instances being attached plus the desired capacity of the group exceeds the maximum size of the group, the operation fails. If there is a Classic Load Balancer attached to your Auto Scaling group, the instances are also registered with the load balancer. If there are target groups attached to your Auto Scaling group, the instances are also registered with the target groups. For more information, see Detach or attach instances in the Amazon EC2 Auto Scaling User Guide.
EXEC aws.autoscaling.auto_scaling_groups.attach_instances
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@region='{{ region }}' --required,
@InstanceIds='{{ InstanceIds }}'
;
Deletes one or more scheduled actions for the specified Auto Scaling group.
EXEC aws.autoscaling.auto_scaling_groups.batch_delete_scheduled_action
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@ScheduledActionNames='{{ ScheduledActionNames }}' --required,
@region='{{ region }}' --required
;
Creates or updates one or more scheduled scaling actions for an Auto Scaling group.
EXEC aws.autoscaling.auto_scaling_groups.batch_put_scheduled_update_group_action
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@ScheduledUpdateGroupActions='{{ ScheduledUpdateGroupActions }}' --required,
@region='{{ region }}' --required
;
Cancels an instance refresh or rollback that is in progress. If an instance refresh or rollback is not in progress, an ActiveInstanceRefreshNotFound error occurs. This operation is part of the instance refresh feature in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group after you make configuration changes. When you cancel an instance refresh, this does not roll back any changes that it made. Use the RollbackInstanceRefresh API to roll back instead.
EXEC aws.autoscaling.auto_scaling_groups.cancel_instance_refresh
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@region='{{ region }}' --required,
@WaitForTransitioningInstances={{ WaitForTransitioningInstances }}
;
Completes the lifecycle action for the specified token or instance with the specified result. This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group: (Optional) Create a launch template or launch configuration with a user data script that runs while an instance is in a wait state due to a lifecycle hook. (Optional) Create a Lambda function and a rule that allows Amazon EventBridge to invoke your Lambda function when an instance is put into a wait state due to a lifecycle hook. (Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon EC2 Auto Scaling to publish lifecycle notifications to the target. Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate. If you need more time, record the lifecycle action heartbeat to keep the instance in a wait state. If you finish before the timeout period ends, send a callback by using the CompleteLifecycleAction API call. For more information, see Complete a lifecycle action in the Amazon EC2 Auto Scaling User Guide.
EXEC aws.autoscaling.auto_scaling_groups.complete_lifecycle_action
@LifecycleHookName='{{ LifecycleHookName }}' --required,
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@LifecycleActionResult='{{ LifecycleActionResult }}' --required,
@region='{{ region }}' --required,
@LifecycleActionToken='{{ LifecycleActionToken }}',
@InstanceId='{{ InstanceId }}'
;
Disables group metrics collection for the specified Auto Scaling group.
EXEC aws.autoscaling.auto_scaling_groups.disable_metrics_collection
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@region='{{ region }}' --required,
@Metrics='{{ Metrics }}'
;
Enables group metrics collection for the specified Auto Scaling group. You can use these metrics to track changes in an Auto Scaling group and to set alarms on threshold values. You can view group metrics using the Amazon EC2 Auto Scaling console or the CloudWatch console. For more information, see Monitor CloudWatch metrics for your Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide.
EXEC aws.autoscaling.auto_scaling_groups.enable_metrics_collection
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@Granularity='{{ Granularity }}' --required,
@region='{{ region }}' --required,
@Metrics='{{ Metrics }}'
;
Moves the specified instances into the standby state. If you choose to decrement the desired capacity of the Auto Scaling group, the instances can enter standby as long as the desired capacity of the Auto Scaling group after the instances are placed into standby is equal to or greater than the minimum capacity of the group. If you choose not to decrement the desired capacity of the Auto Scaling group, the Auto Scaling group launches new instances to replace the instances on standby. For more information, see Temporarily removing instances from your Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
EXEC aws.autoscaling.auto_scaling_groups.enter_standby
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@ShouldDecrementDesiredCapacity='{{ ShouldDecrementDesiredCapacity }}' --required,
@region='{{ region }}' --required,
@InstanceIds='{{ InstanceIds }}'
;
Moves the specified instances out of the standby state. After you put the instances back in service, the desired capacity is incremented. For more information, see Temporarily removing instances from your Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
EXEC aws.autoscaling.auto_scaling_groups.exit_standby
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@region='{{ region }}' --required,
@InstanceIds='{{ InstanceIds }}'
;
Launches a specified number of instances in an Auto Scaling group. Returns instance IDs and other details if launch is successful or error details if launch is unsuccessful.
EXEC aws.autoscaling.auto_scaling_groups.launch_instances
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@RequestedCapacity='{{ RequestedCapacity }}' --required,
@ClientToken='{{ ClientToken }}' --required,
@region='{{ region }}' --required,
@AvailabilityZones='{{ AvailabilityZones }}',
@AvailabilityZoneIds='{{ AvailabilityZoneIds }}',
@SubnetIds='{{ SubnetIds }}',
@RetryStrategy='{{ RetryStrategy }}'
;
Records a heartbeat for the lifecycle action associated with the specified token or instance. This extends the timeout by the length of time defined using the PutLifecycleHook API call. This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group: (Optional) Create a launch template or launch configuration with a user data script that runs while an instance is in a wait state due to a lifecycle hook. (Optional) Create a Lambda function and a rule that allows Amazon EventBridge to invoke your Lambda function when an instance is put into a wait state due to a lifecycle hook. (Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an Amazon SNS topic. The role allows Amazon EC2 Auto Scaling to publish lifecycle notifications to the target. Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate. If you need more time, record the lifecycle action heartbeat to keep the instance in a wait state. If you finish before the timeout period ends, send a callback by using the CompleteLifecycleAction API call. For more information, see Amazon EC2 Auto Scaling lifecycle hooks in the Amazon EC2 Auto Scaling User Guide.
EXEC aws.autoscaling.auto_scaling_groups.record_lifecycle_action_heartbeat
@LifecycleHookName='{{ LifecycleHookName }}' --required,
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@region='{{ region }}' --required,
@LifecycleActionToken='{{ LifecycleActionToken }}',
@InstanceId='{{ InstanceId }}'
;
Resumes the specified suspended auto scaling processes, or all suspended process, for the specified Auto Scaling group. For more information, see Suspend and resume Amazon EC2 Auto Scaling processes in the Amazon EC2 Auto Scaling User Guide.
EXEC aws.autoscaling.auto_scaling_groups.resume_processes
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@region='{{ region }}' --required,
@ScalingProcesses='{{ ScalingProcesses }}'
;
Cancels an instance refresh that is in progress and rolls back any changes that it made. Amazon EC2 Auto Scaling replaces any instances that were replaced during the instance refresh. This restores your Auto Scaling group to the configuration that it was using before the start of the instance refresh. This operation is part of the instance refresh feature in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group after you make configuration changes. A rollback is not supported in the following situations: There is no desired configuration specified for the instance refresh. The Auto Scaling group has a launch template that uses an Amazon Web Services Systems Manager parameter instead of an AMI ID for the ImageId property. The Auto Scaling group uses the launch template's $Latest or $Default version. When you receive a successful response from this operation, Amazon EC2 Auto Scaling immediately begins replacing instances. You can check the status of this operation through the DescribeInstanceRefreshes API operation.
EXEC aws.autoscaling.auto_scaling_groups.rollback_instance_refresh
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@region='{{ region }}' --required
;
Starts an instance refresh. This operation is part of the instance refresh feature in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group. This feature is helpful, for example, when you have a new AMI or a new user data script. You just need to create a new launch template that specifies the new AMI or user data script. Then start an instance refresh to immediately begin the process of updating instances in the group. If successful, the request's response contains a unique ID that you can use to track the progress of the instance refresh. To query its status, call the DescribeInstanceRefreshes API. To describe the instance refreshes that have already run, call the DescribeInstanceRefreshes API. To cancel an instance refresh that is in progress, use the CancelInstanceRefresh API. An instance refresh might fail for several reasons, such as EC2 launch failures, misconfigured health checks, or not ignoring or allowing the termination of instances that are in Standby state or protected from scale in. You can monitor for failed EC2 launches using the scaling activities. To find the scaling activities, call the DescribeScalingActivities API. If you enable auto rollback, your Auto Scaling group will be rolled back automatically when the instance refresh fails. You can enable this feature before starting an instance refresh by specifying the AutoRollback property in the instance refresh preferences. Otherwise, to roll back an instance refresh before it finishes, use the RollbackInstanceRefresh API.
EXEC aws.autoscaling.auto_scaling_groups.start_instance_refresh
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@region='{{ region }}' --required,
@Strategy='{{ Strategy }}',
@DesiredConfiguration='{{ DesiredConfiguration }}',
@Preferences='{{ Preferences }}'
;
Suspends the specified auto scaling processes, or all processes, for the specified Auto Scaling group. If you suspend either the Launch or Terminate process types, it can prevent other process types from functioning properly. For more information, see Suspend and resume Amazon EC2 Auto Scaling processes in the Amazon EC2 Auto Scaling User Guide. To resume processes that have been suspended, call the ResumeProcesses API.
EXEC aws.autoscaling.auto_scaling_groups.suspend_processes
@AutoScalingGroupName='{{ AutoScalingGroupName }}' --required,
@region='{{ region }}' --required,
@ScalingProcesses='{{ ScalingProcesses }}'
;