I’m deploying my environment using Terraform.
I use this resource: Terraform Registry
to create a machine with env variables that are stored in Terraform Cloud.
Then when I want to upgrade the docker container to a new version, if I try to do
fly deploy, I get:
Error: found 1 machines that are unmanaged. `fly deploy` only updates machines with fly_platform_version=v2 in their metadata. Use `fly machine list` to list machines and `fly machine update --metadata fly_platform_version=v2 <machine id>` to update individual machines with the metadata. Once done, `fly deploy` will update machines with the metadata based on your fly.toml app configuration
I tried to do so, but when I do a
fly deploy after that, the env variables values are the initial values (i.e. no env variable I added since then exists and my container fails).
I guess this is what you mean with
fly deploy will update machines with the metadata based on your fly.toml but I don’t even have a fly.toml, so where does Fly get this old variable values?
How can I make a Terraform infrastructure work with the
fly deploy method and on V2 (I would like to avoid manually pushing to a repository then updating the image tag in the terraform, I love the simplicity of fly deploy and would like terraform to only manage infra and env variables)
Thanks a lot for your help!