Posts

Showing posts from October, 2025

Deployment Strategies In AWS ASG - Terminate and Launch

Image
    Terminate and Launch: Terminate the existing instance and launch a new instance with updated LT. In this strategy we will change the minimum number of instances to be running during the time of deployment.  I have 5 EC2 instances under the ASG which are running on version LT1. Setting minimum 10% -> Ensure 1 machine is actively taking traffic and others are updated. Setting minimum 50% -> Ensure 3 machines are active and 2 are updated. Setting minimum 90% -> Ensure 4 machines are active and 1 is updated. Increasing the minimum will increase the deployment time. Please find the below table for better understanding. Instances # Min Healthy Instances Minimum Must Machines Instances # Patched at a time 10 20% 2 8 10 30% 3 7 10 40% 4 6 10 50% 5 5 10 ...

Deployment Strategies In AWS ASG - Launch before Terminating

Image
  We all know what is AWS ASG ( Auto Scaling Group ) which scales EC2 instances based on CloudWatch metrics . Backbone of ASG is Launch Template ( LT ), which acts like a blue print for creating EC2 instances. Whenever, there is an update to the LT, existing instances must be updated safely without having much downtime or with near zero downtime . ASG offers various methods of instance refresh .  1) Launch before Terminating . 2) Terminate and Launch . 3) Custom Behavior . Launch and Terminate: As the name says, it creates new instance with latest LT before terminating existing instances.   Launch new instances and wait for them to be ready before terminating others. This allows you to go above your desired capacity by a given percentage and may temporarily increase costs. Let's say the ASG has desired capacity of 5 EC2 instance. "Launch before Terminating" strategy ensures it always has 5 EC2 instances exist. With "Launch before Terminating": At any given t...