Design Cost-Optimized Architecture
DevOps & Cloud Engineer with 3.5+ years of AWS experience managing multi-cluster Kubernetes platforms and 70+ microservices. Specialized in Terraform (IaC), CI/CD automation, and GitOps (ArgoCD), building secure, highly available, and cost-optimized cloud-native platforms with strong expertise in AWS architecture and security hardening.
🎯 EC2 Auto Scaling Default Termination Policy Order
👉 When Auto Scaling needs to terminate an instance, it checks in this order:
Spot vs On-Demand
(Terminate Spot first, if mixed.)Oldest Launch Configuration
(Terminate instance using the oldest launch configuration.)Oldest Launch Template
(If no launch configuration, terminate instance with oldest launch template.)Oldest Instance
(By launch time.)Closest to Billing Hour
(If all else is equal.)
🧠 Easy memory trick:
"Spot → Config → Template → Time → Billing" ✅
Just remember:
"SCTTB = Spot, Config, Template, Time, Billing**"
⚡ Quick Apply to Your Question:
Instance B = Oldest launch configuration → ✅ TERMINATE!
Instance A = Oldest launch template (lower priority than config).
Instance C = Newest launch config → safe.
Instance D = Closest to billing hour → last check.
✅ Therefore, Instance B is the correct answer!
Launch Template and Launch Configuration:
Launch Template: Can mix On-Demand + Spot Instances and multiple instance types. ✅
(Best for cost optimization and flexibility.)Launch Configuration: Cannot mix On-Demand + Spot or multiple instance types. ❌
(Older, less flexible.)
Quick Tip:
Need mixed instances (On-Demand + Spot)? Only launch templates can do this! Remember:
"Templates are flexible, Configurations are not."
(Other options are wrong because they either overpromise or underdeliver.)