Closed tzouris closed 1 month ago
Process:
Edit auto-scaling group
Create new launch template version with new instance type (downscaling from m7g.8xlarge to m7g.4xlarge)
Update the hardware specs in the task definition
Leaving 20% headroom for the ECS container and system resources 16 vCPUs & 64 GB memory available 10 vCPUs for the task (the max) - left empty since this is optional for EC2 instances 56 GB RAM for the task
Make new LT version the default
Update ASG with new LT version
Increase the number of desired instances - a new instance is deployed
Edit the default load balancer rule and put up the maintenance message
Stop the ECS task
Decrease the amount of desired instances on the ASG - the old instance is terminated
Start the task
Update the ALB target group - this took about 5 mins.
Re-assign the Elastic IP to the new instance
Check with VPN if site loads
Restore the ALB rule - default points back to ecs-commons-wordpress target group
Duration of entire process: 20 mins
No security groups needed to be updated because of the way they are configured.
From m7g.8xlarge to m7g.4xlarge.