All Products
Search
Document Center

Auto Scaling:Scaling policies

Last Updated:Mar 31, 2026

Auto Scaling selects which instances to add or remove during a scale-out or scale-in event based on the active scaling policy. Choosing the right policy determines how instances are distributed across zones, how spot and pay-as-you-go capacity is balanced, and how costs are managed at scale.

Choose a scaling policy

Auto Scaling provides four scaling policies. The table below summarizes when to use each one.

PolicyBest forMulti-zone supportSpot instancesComplexity
Priority Policy (default)Simple workloads with a preferred zoneFallback onlyNoLow
Balanced Distribution PolicyWorkloads requiring zone redundancy and disaster recoveryActive balancingNoLow
Cost Optimization Policy (recommended for cost-sensitive workloads)Cost-sensitive workloads using multiple instance types or spot instancesFallback onlyYesMedium
Custom Combination PolicyWorkloads needing precise control over spot/pay-as-you-go ratio, zone distribution, and instance selectionActive balancingYesHigh
Important

The scaling policy can only be changed when the scaling group Type is ECS. For ECI scaling groups, the policy is always Priority Policy and cannot be changed.

Policy descriptions

Priority Policy

The default policy. During scale-out, instances are created in the zone of the highest-priority vSwitch first. If creation fails due to insufficient inventory, the system falls back to the next-priority vSwitch's zone. Scale-in removes instances in reverse priority order.

API value: MultiAZPolicy = PRIORITY

Balanced Distribution Policy

Distributes instances evenly across all zones configured for the scaling group. Use this policy when zone redundancy and multi-zone disaster recovery are priorities.

If instances become unbalanced across zones (for example, due to inventory limitations), run a manual rebalancing operation. See Rebalance ECS instances.

API value: MultiAZPolicy = BALANCE

Important

The scaling group must have vSwitches configured in multiple zones.

Child configuration items

Configuration itemDescription
Balance modeControls fallback behavior when instance creation fails in a zone. Best-effort Delivery (default): falls back to another zone. Balanced Only: does not fall back.
Enable auto-rebalanceWhen enabled, the scaling group automatically detects zone imbalances and proactively scales out or in across zones to restore balance. Takes effect only when Balance mode is set to Balanced Only.

Cost Optimization Policy

Creates instances in ascending order of vCPU unit price. If the scaling configuration includes spot instances, spot instances are created first. If spot capacity is unavailable, the system falls back to pay-as-you-go instances. During scale-in, instances with the highest vCPU unit price are removed first.

Important

This policy takes effect only if the scaling configuration specifies multiple instance types or enables spot instances.

API value: MultiAZPolicy = COST_OPTIMIZED

Child configuration items

Configuration itemDefaultDescription
Minimum pay-as-you-go instances0The minimum number of pay-as-you-go ECS instances the scaling group must maintain. When the current count falls below this value, pay-as-you-go instances are created first during scale-out.
Percentage of pay-as-you-go instances70%The percentage of pay-as-you-go instances among automatically created instances that exceed the minimum count.
Lowest cost instance types1The number of lowest-priced instance types used when creating spot instances. Spot instances are distributed evenly across these instance types. Applies only when multiple instance types are specified.
Enable supplemental spot instancesOffWhen enabled, the system creates a replacement spot instance approximately 5 minutes before a scheduled reclamation, reducing interruption risk.
Use pay-as-you-go instances to supplement spot capacityOnWhen spot capacity cannot be met due to pricing or inventory, the system automatically creates pay-as-you-go instances to meet the required capacity.
Replace pay-as-you-go instance with spot instanceOffWhen Use pay-as-you-go instances to supplement spot capacity is enabled, pay-as-you-go instances may exceed the configured percentage. Enable this option to automatically replace those excess pay-as-you-go instances with spot instances when spot capacity becomes available.

How on-demand and spot capacity scales together

The Minimum pay-as-you-go instances and Percentage of pay-as-you-go instances settings interact as the group grows. The following example uses a minimum of 2 pay-as-you-go instances and a 30% pay-as-you-go percentage above the minimum:

Group sizePay-as-you-go (minimum)Pay-as-you-go (above minimum, 30%)Spot instances
2 instances200
10 instances22 (30% of 8)6
20 instances25 (30% of 18)13
30 instances28 (30% of 28)20

The minimum is always reserved as pay-as-you-go. The percentage applies only to instances above that minimum.

Custom Combination Policy

Provides full control over capacity distribution: the ratio of pay-as-you-go to spot instances, multi-zone balancing, and instance type selection strategy. Use this policy when the Cost Optimization Policy does not offer enough control for your workload requirements.

API value: MultiAZPolicy = COMPOSABLE

Child configuration items

Configuration itemDefaultDescription
Minimum pay-as-you-go instances0The minimum number of pay-as-you-go ECS instances the scaling group must maintain.
Percentage of pay-as-you-go instances70%The percentage of pay-as-you-go instances among automatically created instances that exceed the minimum count.
Multi-zone balanced distributionOffDistributes ECS instances evenly across the zones specified for the scaling group. Requires multiple vSwitches. If instances become unbalanced, run a rebalancing operation. See Rebalance ECS instances.
Capacity Planning PolicyDetermines how the scaling group selects instance types to meet capacity requirements. Instance Type Configuration Order: creates instances in the configured order. Lowest Price: creates instances in ascending order of vCPU unit price.
Configure Spot Capacity Planning PolicyOffWhen enabled, applies a separate capacity planning policy for spot instances.
Spot Capacity Planning PolicySame options as Capacity Planning Policy. Applies only to spot instances when Configure Spot Capacity Planning Policy is enabled.
Lowest cost instance typesThe number of lowest-priced instance types used when creating spot instances. Applies when Capacity Planning Policy or Spot Capacity Planning Policy is set to Lowest Price.
Enable supplemental spot instancesOffCreates a replacement spot instance approximately 5 minutes before a scheduled reclamation.
Use pay-as-you-go instances to supplement spot capacityOnWhen spot capacity cannot be met, the system creates pay-as-you-go instances to fill the gap.
Replace pay-as-you-go instance with spot instanceOffAutomatically replaces excess pay-as-you-go instances with spot instances when spot capacity becomes available.

Configure the scaling policy

Change the policy on an existing scaling group

  1. Log on to the Auto Scaling console.

  2. Log on to the Auto Scaling console.

  3. In the left navigation pane, click Scaling Groups.

  4. In the top navigation bar, select the region where Auto Scaling is activated.

  5. On the Scaling Group Management page, find the target scaling group. In the Actions column, click Modify.

  6. In the Modify Scaling Group window, set Scaling Policy to the desired policy. If you select the Balanced Distribution Policy, Cost Optimization Policy, or Custom Combination Policy, configure the related child items described in the sections above.

  7. Click OK.

Set the policy when creating a scaling group

Set Scaling Policy on the creation page as shown below.

image

If you select the Cost Optimization Policy or Custom Combination Policy, configure the related child items.

Change the scaling policy using the API

Use the ModifyScalingGroup operation to change the scaling policy programmatically. The required parameters vary by policy.

Priority Policy

ParameterTypeRequiredValue
ScalingGroupIdstringYesThe ID of the scaling group.
MultiAZPolicystringYesSet to PRIORITY.

Balanced Distribution Policy

Important

The scaling group must have vSwitches configured in multiple zones.

ParameterTypeRequiredDescription
ScalingGroupIdstringYesThe ID of the scaling group.
MultiAZPolicystringYesSet to BALANCE.
BalanceModestringNoBalancedBestEffort (default): falls back to another zone if creation fails. BalancedOnly: does not fall back.
AutoRebalancebooleanNotrue: enables automatic zone rebalancing. false (default): disabled. Takes effect only when BalanceMode=BalancedOnly.

To manually trigger rebalancing, see RebalanceInstances.

Cost Optimization Policy

Important

This policy takes effect only if the scaling configuration specifies multiple instance types or enables spot instances.

ParameterTypeRequiredRangeDefaultDescription
ScalingGroupIdstringYesThe ID of the scaling group.
MultiAZPolicystringYesSet to COST_OPTIMIZED.
OnDemandBaseCapacityintegerNo0–10000The minimum number of pay-as-you-go instances. When the current count falls below this value, pay-as-you-go instances are created first.
OnDemandPercentageAboveBaseCapacityintegerNo0–1000The percentage of pay-as-you-go instances among instances above OnDemandBaseCapacity.
SpotInstancePoolsintegerNo0–102The number of lowest-priced instance types for spot instance creation. Spot instances are distributed evenly across these types.
SpotInstanceRemedybooleanNotrue/falsetrue: creates a replacement spot instance approximately 5 minutes before reclamation.
CompensateWithOnDemandbooleanNotrue/falsetrue: creates pay-as-you-go instances when spot capacity is insufficient.
CapacityOptions.SpotAutoReplaceOnDemandbooleanNotrue/falsetrue: replaces excess pay-as-you-go instances with spot instances when CompensateWithOnDemand is enabled.

Custom Combination Policy

ParameterTypeRequiredRangeDefaultDescription
ScalingGroupIdstringYesThe ID of the scaling group.
MultiAZPolicystringYesSet to COMPOSABLE.
OnDemandBaseCapacityintegerNo0–10000The minimum number of pay-as-you-go instances.
OnDemandPercentageAboveBaseCapacityintegerNo0–100100The percentage of pay-as-you-go instances among instances above OnDemandBaseCapacity.
AzBalancebooleanNotrue/falsetrue: distributes ECS instances evenly across all configured zones.
AllocationStrategystringNopriority / lowestPricepriorityDetermines how instance types are selected. priority: uses configured order. lowestPrice: uses ascending vCPU price order.
SpotAllocationStrategystringNopriority / lowestPriceA separate allocation strategy for spot instances.
SpotInstancePoolsintegerNo0–102The number of lowest-priced instance types for spot creation. Required when AllocationStrategy or SpotAllocationStrategy is lowestPrice.
SpotInstanceRemedybooleanNotrue/falsetrue: creates a replacement spot instance approximately 5 minutes before reclamation. Required when AllocationStrategy or SpotAllocationStrategy is lowestPrice.
CompensateWithOnDemandbooleanNotrue/falsetrue: creates pay-as-you-go instances when spot capacity is insufficient. Required when AllocationStrategy or SpotAllocationStrategy is lowestPrice.
CapacityOptions.SpotAutoReplaceOnDemandbooleanNotrue/falsetrue: replaces excess pay-as-you-go instances with spot instances.

What's next