Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change instance type in AWS ECS cluster?

I have a cluster in AWS EC2 Container Service. When I've set it up, I used t2.micro instances because those were sufficient for development. Now I'd like to use more powerful instances, like m4.large.

I would like to know whether it is possible to change the instance types only, so I don't need to recreate the whole cluster. I could not find how to do this.

like image 261
vargen_ Avatar asked Jun 19 '17 18:06

vargen_


People also ask

Can you change EC2 instance type?

You can't change the instance type of a Spot Instance. If your instance is in an Auto Scaling group, the Amazon EC2 Auto Scaling service marks the stopped instance as unhealthy, and may terminate it and launch a replacement instance.


1 Answers

Yes, you can achieve this in CloudFormation.

  • Click on the Stack corresponding to your ECS-Cluster.
  • Click Update Stack
  • Use radiocurrent template, Next
  • change EcsInstanceType
  • Next, Next, Update
  • Upscale your cluster to 2*n instances
  • Wait for the n new instances of the new type being created
  • Downscale your cluster to n
  • Or you could just drain and terminate the instances 1 by 1
like image 74
revau.lt Avatar answered Sep 29 '22 13:09

revau.lt