Auto Scaling

EC2 VMs can be placed into Auto Scaling Groups which can be dynamically created and destroyed based on metrics such as CPU utilisation or load averages.

By default, EC2 auto-scaling operations are performed immediately, without warning and without awareness of the workload running on EC2 instances.

  • Auto-scale terminates on scale-in.
  • Infrastructure patching terminates and replaces

Instance lifecycle

stateDiagram-v2 direction TB PendingLifecycleHooks: Lifecycle hooks state PendingLifecycleHooks { PendingWait: Pending\u003A Wait PendingProceed: Pending\u003A Proceed [*] --> PendingWait PendingWait --> PendingProceed PendingProceed --> [*] } [*] --> Pending Pending --> PendingLifecycleHooks: Initial launch PendingLifecycleHooks --> InService Pending --> InService InService --> EnteringStandby: User puts instance into standby EnteringStandby --> Standby Standby --> InService: User returns instance to service TerminatingLifecycleHooks: Lifecycle hooks state TerminatingLifecycleHooks { TerminatingWait: Terminating\u003AWait TerminatingProceed: Terminating\u003AProceed [*] --> TerminatingWait TerminatingWait --> TerminatingProceed TerminatingProceed --> [*] } InService --> Terminating: Scale-in InService --> Terminating: Failed health check Terminating --> TerminatingLifecycleHooks TerminatingLifecycleHooks --> Terminated Terminating --> Terminated Terminated --> [*] InService --> Detaching: User detaches instance Detaching --> Detached Detached --> [*]