INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: EC2: launch and operation

EC2 Auto Scaling basics: minimum, desired and maximum capacity explained

Amazon EC2 Auto Scaling manages groups of EC2 instances, maintaining desired capacity and adjusting it under configured conditions. Launch settings, capacity targets, health decisions and scaling policies are different controls. This lesson uses equal instances, with one instance representing one capacity unit.

What you will learn

Distinguish launch templates, groups, desired versus actual capacity, health and scaling policies; explain failed scale-out and replacement after manual termination.

Prerequisite

Know EC2, AMIs, Regions/AZs and user data. Diagrams and numbers are fixed teaching examples, not live metrics or availability/cost estimates. No real group is created.

Separate launch configuration, capacity, health and scaling

Controls used by a group; this is not a network-path diagram
Controls used by a group; this is not a network-path diagram1: Launch template — Supplies settings for newly launched instances. — Auto Scaling group. 2: Scaling policy — Adjusts capacity targets under defined conditions. — Auto Scaling group. 3: Auto Scaling group — Maintains targets and replaces instances based on applicable health results. — Managed EC2123Launch templateAuto Scaling groupScaling policyManaged EC2Controls used by a group; this is not a network-path diagram1: Launch template — Supplies settings for newly launched instances. — Auto Scaling group. 2: Scaling policy — Adjusts capacity targets under defined conditions. — Auto Scaling group. 3: Auto Scaling group — Maintains targets and replaces instances based on applicable health results. — Managed EC2123Launch templateAuto ScalinggroupScaling policyManaged EC2
  1. Launch template → Auto Scaling groupSupplies settings for newly launched instances.
  2. Scaling policy → Auto Scaling groupAdjusts capacity targets under defined conditions.
  3. Auto Scaling group → Managed EC2Maintains targets and replaces instances based on applicable health results.
Launch template
AMI, type, SG and initialization settings.
Auto Scaling group
Manages placement, capacity targets and instances.
Scaling policy
Uses configured signals to adjust desired capacity.
Managed EC2
Inspect launch, health and termination state.

A launch template collects settings for new instances. Successfully creating one does not prove it can launch instances; check combinations such as AMI/type compatibility. A template update is not evidence that every existing instance was updated.

Minimum, desired and maximum have different roles

Example with equal types and one unit per instance
SettingMeaningExample
MinimumLower bound for the capacity target1
DesiredThe capacity the group attempts to maintain2
MaximumUpper bound for the capacity target3
Actual stateObserved pending, running, terminating and related statesEven with a target of 2, startup or failure can cause temporary differences

This example constrains the target to 1 ≤ desired ≤ 3. Desired capacity 2 does not guarantee two healthy applications are immediately ready. Launch configuration, available capacity, quotas, networking, permissions and initialization also matter. With weighted capacity or different types, capacity units and instance counts need separate interpretation.

Choose an option to see the result and explanation.

Minimum is 1, desired is 2 and maximum is 3. Can a normal scaling policy raise desired capacity to 4?
Read the answer and reason

Answer: No: this configuration bounds desired capacity at 3 · Maximum capacity bounds the desired-capacity target. Whether that bound provides sufficient capacity is a separate design question.

Health checks and request distribution are different concerns

Establish what the health signal actually checks
Signal/controlRoleCaution
EC2 status checksDetect relevant instance/platform/OS problemsThey do not imply an unconfigured HTTP application check
ELB health checksUse health reported by the load balancerEnable ELB health-check use for the group
Application-specific checksDesign checks for app responses and dependenciesCheck the chosen mechanism and aggregation, including EC2 application status checks
Load balancerAccept and distribute requestsSeparate from Auto Scaling; review target registration, routing and cost

Distinguish health-check grace from instance warmup

Both involve time, but govern different decisions
ControlPrimary decision affectedHow to choose
Health-check grace periodAvoid unnecessary replacement during initializationReview app startup and the chosen health mechanisms
Default instance warmupWhen new-instance metrics contribute to scaling decisions and related capacity treatmentObserve initialization/traffic readiness and configure accordingly

During the grace period, an instance that leaves EC2 running state can still be marked unhealthy and replaced. Elapsed warmup alone does not prove business-process health. Defaults and fallbacks depend on scaling features; do not assume both controls have identical values or meanings.

Worked example: distinguish replacement from scale-out

Fixed min 1 / desired 2 / max 3 example; not live AWS state
ObservationInterpretation
One of two instances is manually terminatedThe group attempts replacement to maintain desired capacity 2
Load rises but no scaling policy was configuredCreating a group does not automatically implement the intended demand response
Desired becomes 3 but one launch failsSeparate the target from actual capacity and inspect scaling/launch activity
The workload exceeds what maximum 3 can handleReview app bottlenecks, dependencies and costs, not just the limit

Choose an option to see the result and explanation.

You terminate a member but another instance launches. What should you check first?
Read the answer and reason

Answer: Group desired capacity and membership · Auto Scaling attempts to maintain desired capacity. Cleanup must account for the group, scaling controls and remaining resources, not just individual EC2 members.

In operation, separate capacity limits from spending limits

Increasing capacity can change EC2, EBS, IPv4, monitoring and load-balancer costs. Maximum capacity is not an account-wide spending cap. Maintaining minimum capacity can still incur costs; define the end condition and reconcile remaining resources.

  1. Review template/version, subnets/AZs and initialization.
  2. Define capacity units, min/desired/max and scaling conditions.
  3. Review health sources, grace, warmup and request distribution.
  4. Record target versus actual state, launch failures and app behavior separately.
  5. Decide how to handle the group, scaling controls, instances, storage and related resources after the exercise.

Check, then explain in your own words

  1. Separate what to launch from how much capacity to maintain.
  2. Reconcile targets, actual state and application health.
  3. Explain replacement, demand scaling, cost and cleanup separately.
Check your understanding: Does creating an Auto Scaling group automatically make an app highly available and inexpensive?

No. Placement, health, scaling, application state and cost need explicit design.

Maintaining desired capacity is different from completing a user request. Check dependencies, initialization, request distribution, storage and end conditions.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.