You updated the launch template with a new AMI, but new ASG instances still boot the old AMI.
BeginnerTroubleshootingEC2, Auto Scaling and Load Balancing
Answer
Likely causes → The ASG references a specific template version, or $Default, and you created a new version without making it the default. New versions are not used until the ASG points at them.
Diagnose →
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names web-asg \
--query 'AutoScalingGroups[].[LaunchTemplate,MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification]'
aws ec2 describe-launch-template-versions --launch-template-id lt-0abc \
--query 'LaunchTemplateVersions[].[VersionNumber,DefaultVersion,LaunchTemplateData.ImageId]'
Fix →
- Point the ASG at
$Latest, or set the new version as default:aws ec2 modify-launch-template --launch-template-id lt-0abc --default-version 7 - Start an instance refresh to replace the instances that are already running
Prevent → Have the pipeline create the version, update the ASG and start an instance refresh in one step.