Destroy & re-create or auto-audjust instance type?

I see from here that one change the instance type. But how does this work ? it re-creates the EC2/VM and destroys the old one ?

If I remember correctly, one can manually change (only upgrade) the droplet size in DigitOcean - but not downgrade it - and this doesn’t seem to bring down the server because the droplet is not destroyed when upgrading.

I am looking for allowing to change instance types of an AWS EC2 or a GCP Compute Engine.
How does Terraform handle this ?

That information in that link claims to be AI generated, so I would not trust that any of it is actually correct. Whether any parameters of a resource can be changes without replacement of that resource is defined within the provider, and not decided by Terraform.

I don’t know offhand how each of these provider handles changing the instance_type, but you can always change the argument and inspect the plan output to see the result. If the instance is planned for replacement, the plan output will add # forces replacement next to the attribute change which the provider indicated requires the replacement.

1 Like