Changing instance region is not terminating previous one

Hello, I have a simple configuration to create an instance on AWS, using instance type and region as variables. Changing instance type works as expected, but changing region leaves the previous one in an orphan state (not terminated).
Can someone reproduce this and check if it’s a bug?
Thanks

Hi @pep,

Because AWS regions are tied to the provider, changing the region will not change the resource configuration, and hence not produce a plan to change any instances. Since EC2 instances are also only located in a specific region, there is no way to indicate to the provider that the instance should exist but is not visible in the current region, Terraform can only see that the instance it created no longer exists from the provider’s point of view.

1 Like