I have experience with Terraform, so when I came to Fly, and I am using the fly.toml config, I expected a more declarative nature.
Does Fly.io address why it is not so declarative? Am I just using it wrong?
For example, I have an app running on machines in iad, but decided I want to use ewr instead. Intuitively, I thought I could just change primary_region, fly deploy, and Fly would handle spinning down iad and up in ewr, but in reality it does nothing. I have to instead go about the CLI myself, scale to 0, scale to 2 then configure one machine a standby.
This seems really unintuitive and not user-friendly, am I going about the configuration the wrong way? Is Fly intended to be much more focused around the CLI?
For sure it could be more user friendly. I don’t know the technical reasons but primary_region is set in the initial launch of the app. Maybe there’s a lot of complexity required to automatically migrate primary regions, eg proxy or something? I don’t know.
You’re not using it wrong, it’s just the way it is. Btw, how often are you changing the primary region?
fly.toml is more about the configuration of the machines rather than the placement of machines.
Modifying your fly.toml file won’t suddenly destroy all your machines or move them to completely different regions and that’s a good thing.
Machine placement is outside the scope of fly.toml, aside from things like constraints around CPU type, CPU size, etc which can be optionally configured in the fly.toml file.
primary_region is more of a helper especially during the initial setup, it doesn’t really do much after setup.