How to change instance type in AWS ECS cluster?

vargen_ picture vargen_ · Jun 19, 2017 · Viewed 14.7k times · Source

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.

Answer

revau.lt picture revau.lt · Sep 29, 2017

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