1

I'm getting puzzled by this. I need to increase the specifications of an EC2 instance and am following this tutorial: Change the instance type for the current instance configuration

But it appears that the instance is connected to an autoscaling group, so as soon as I stop it, another one is spawn, and the one I stopped is terminated, so I can't change its type.

I tried detatching the instance from the autoscaling group, but it doesn't do it because there needs to be at least one.

And if I change the minimum capacity it actually also terminates it and can't update its type.

How can I change the instance type of this EC2 box?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Don Giulio
  • 2,946
  • 3
  • 43
  • 82

3 Answers3

1

Auto Scaling groups have either a Launch Template or Launch Configuration attached to them. These specify what kind of properties have the instances which are launched by the auto scaling group.

If you want to modify the type of an instance controlled by an ASG, you have to update the Launch Configuration/Launch Template. Afterwards, you can terminate the running instances one by one, the auto scaling group will relaunch them with the updated properties.

Ervin Szilagyi
  • 14,274
  • 2
  • 25
  • 40
0

Try creating a new launch configuration with the new ami and point the auto scaling group to use it

EDIT:

Try following this : https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html

TheWalkingMalteser
  • 561
  • 1
  • 9
  • 25
0

The correct way to modify the instance size is by changing the Launch Template or Launch Configuration. Note that this will only apply to newly launched instances, not existing instances.

If you particularly want to keep an existing instance, you could suspend autoscaling processes with:

aws autoscaling suspend-processes

Then you can stop/modify/start the instance. Then, reactivate processes with:

aws autoscaling resume-processes
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470