2 ms·
One thing that terraform does (see below) is that it diffs the desired state with current state (again: see below), and then makes the necessary changes. So, i
by Someone 4y ago
One thing that terraform does (see below) is that it diffs the desired state with current state (again: see below), and then makes the necessary changes.
So, if you have terraformed a load balancer balancing load between 2 machines, and change your terraform to declare a load balancer balancing load between 3 machines, it won’t destroy two machines, destroy the load balancer, create a new load balancer, and then create 3 machines.
Instead, it will create a new machine and change the load balancer to know about it, so that your service is uninterrupted.
Problem is that the above isn’t quite true.
Firstly, comparing with the current state is slow, so terraform has a cache of what it thinks the current state is. If they get out of sync, things can get interesting.
Secondly, all changes are done by plugins of varying quality. Your cloud provider may, for example, support reconfiguration of a load balancer, but if the plug-in doesn’t, terraform will destroy and create a new one.