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.
Distinguish launch templates, groups, desired versus actual capacity, health and scaling policies; explain failed scale-out and replacement after manual termination.
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
- Launch template → Auto Scaling groupSupplies settings for newly launched instances.
- Scaling policy → Auto Scaling groupAdjusts capacity targets under defined conditions.
- 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
| Setting | Meaning | Example |
|---|---|---|
| Minimum | Lower bound for the capacity target | 1 |
| Desired | The capacity the group attempts to maintain | 2 |
| Maximum | Upper bound for the capacity target | 3 |
| Actual state | Observed pending, running, terminating and related states | Even 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.
Health checks and request distribution are different concerns
| Signal/control | Role | Caution |
|---|---|---|
| EC2 status checks | Detect relevant instance/platform/OS problems | They do not imply an unconfigured HTTP application check |
| ELB health checks | Use health reported by the load balancer | Enable ELB health-check use for the group |
| Application-specific checks | Design checks for app responses and dependencies | Check the chosen mechanism and aggregation, including EC2 application status checks |
| Load balancer | Accept and distribute requests | Separate from Auto Scaling; review target registration, routing and cost |
Distinguish health-check grace from instance warmup
| Control | Primary decision affected | How to choose |
|---|---|---|
| Health-check grace period | Avoid unnecessary replacement during initialization | Review app startup and the chosen health mechanisms |
| Default instance warmup | When new-instance metrics contribute to scaling decisions and related capacity treatment | Observe 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
| Observation | Interpretation |
|---|---|
| One of two instances is manually terminated | The group attempts replacement to maintain desired capacity 2 |
| Load rises but no scaling policy was configured | Creating a group does not automatically implement the intended demand response |
| Desired becomes 3 but one launch fails | Separate the target from actual capacity and inspect scaling/launch activity |
| The workload exceeds what maximum 3 can handle | Review app bottlenecks, dependencies and costs, not just the limit |
Choose an option to see the result and explanation.
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.
- Review template/version, subnets/AZs and initialization.
- Define capacity units, min/desired/max and scaling conditions.
- Review health sources, grace, warmup and request distribution.
- Record target versus actual state, launch failures and app behavior separately.
- Decide how to handle the group, scaling controls, instances, storage and related resources after the exercise.
Check, then explain in your own words
- Separate what to launch from how much capacity to maintain.
- Reconcile targets, actual state and application health.
- 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.
- What is Amazon EC2 Auto Scaling?Checked:
Scope and conditionsGroup management, maintaining desired capacity, configured demand scaling and separate request distribution. Not automatic application availability.
Used in this lessonSeparate launch configuration, capacity, health and scaling Health checks and request distribution are different concerns
Scope and conditionsMinimum <= desired <= maximum targets and attempted replacement; actual state can lag. Example assumes equal instances, not weighted capacity.
Used in this lessonMinimum, desired and maximum have different roles Worked example: distinguish replacement from scale-out
Scope and conditionsLaunch settings/AMI compatibility; template creation does not validate all launch combinations. Existing instances need separate rollout decisions.
Used in this lessonSeparate launch configuration, capacity, health and scaling Minimum, desired and maximum have different roles
Scope and conditionsDefault EC2 checks, opt-in ELB/Lattice/EBS and configured EC2 application-status aggregation. Check scope rather than assuming application coverage.
Used in this lessonHealth checks and request distribution are different concerns
Scope and conditionsInitialization grace and immediate unhealthy handling when EC2 leaves running state. No fixed time recommendation or blanket ignored-health claim.
Used in this lessonDistinguish health-check grace from instance warmup
Scope and conditionsNew-instance metric aggregation and capacity/scaling treatment; distinguish grace/defaults/fallbacks and actual application readiness.
Used in this lessonDistinguish health-check grace from instance warmup
- Amazon EC2 On-Demand pricingChecked:
Scope and conditionsCompute assumptions, OS-specific billing granularity, data transfer and additional resource charges; no unit rates embedded.
Used in this lessonIn operation, separate capacity limits from spending limits
- Amazon EBS pricingChecked:
Scope and conditionsProvisioned capacity, additional performance and snapshots; no unit rate or price quote is embedded.
Used in this lessonIn operation, separate capacity limits from spending limits
- Amazon VPC pricingChecked:
Scope and conditionsPublic IPv4 and NAT gateway pricing dimensions, including retained/idle addresses; no unit-rate quote.
Used in this lessonIn operation, separate capacity limits from spending limits
- Managing costs with AWS BudgetsChecked:
Scope and conditionsNotification and billing delays; alert is not a hard cap
Used in this lessonIn operation, separate capacity limits from spending limits