0
0
AWScloud~10 mins

Minimum, maximum, and desired capacity in AWS - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Minimum, maximum, and desired capacity
Start Auto Scaling Group
Check Desired Capacity
Is Desired < Minimum?
YesSet Desired = Minimum
Proceed
Is Desired > Maximum?
YesSet Desired = Maximum
Proceed
Launch or Terminate Instances to Match Desired
End
The system checks desired capacity against minimum and maximum limits, adjusts if needed, then launches or terminates instances to match desired capacity.
Execution Sample
AWS
MinCapacity=2
MaxCapacity=5
DesiredCapacity=6

if DesiredCapacity < MinCapacity:
    DesiredCapacity = MinCapacity
elif DesiredCapacity > MaxCapacity:
    DesiredCapacity = MaxCapacity

LaunchInstances(DesiredCapacity)
This code ensures desired capacity stays within min and max limits before launching instances.
Process Table
StepVariable CheckedConditionAction TakenResulting DesiredCapacity
1DesiredCapacity=66 < 2?No change6
2DesiredCapacity=66 > 5?Set DesiredCapacity = 55
3LaunchInstancesLaunch 5 instancesInstances launched5
💡 DesiredCapacity adjusted to max 5; 5 instances launched to match desired capacity.
Status Tracker
VariableStartAfter Step 1After Step 2Final
MinCapacity2222
MaxCapacity5555
DesiredCapacity6655
Key Moments - 2 Insights
Why does DesiredCapacity change from 6 to 5?
Because DesiredCapacity exceeded MaxCapacity (step 2 in execution_table), it was set down to MaxCapacity to respect the limit.
What happens if DesiredCapacity is less than MinCapacity?
DesiredCapacity is raised to MinCapacity to ensure minimum instances are running, similar to how it was capped at max in step 2.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is DesiredCapacity after step 1?
A2
B5
C6
DUndefined
💡 Hint
Check the 'Resulting DesiredCapacity' column in row for step 1.
At which step does DesiredCapacity get adjusted to respect limits?
AStep 1
BStep 2
CStep 3
DNo adjustment
💡 Hint
Look for the step where 'Action Taken' changes DesiredCapacity.
If MinCapacity was 7 instead of 2, what would DesiredCapacity be after adjustments?
A7
B5
C6
DCannot determine
💡 Hint
Consider that DesiredCapacity must be at least MinCapacity, referencing variable_tracker logic.
Concept Snapshot
Minimum, maximum, and desired capacity control how many instances run.
Desired capacity is adjusted to be no less than minimum and no more than maximum.
AWS Auto Scaling launches or terminates instances to match the desired capacity.
This ensures resources are within set limits for cost and performance.
Full Transcript
In AWS Auto Scaling, you set three key numbers: minimum capacity, maximum capacity, and desired capacity. The system checks if the desired capacity is below the minimum or above the maximum. If it is, it adjusts the desired capacity to fit within those limits. Then it launches or terminates instances to match the adjusted desired capacity. For example, if desired capacity is 6 but maximum is 5, it lowers desired capacity to 5 and launches 5 instances. This keeps your resources balanced and controlled.