So it turns out that my Terraform + GraphQL approach assumes that it’s possible to push an image to registry.fly.io before running the launchApp GraphQL mutation.
Is it possible to make this work somehow? My current build + deploy setup is:
build with bazel
push any containers to docker registry
render terraform modules
run terraform apply
I need terraform to do things like create DNS entries, S3 buckets, IAM keys and other things that affect my fly app secrets.
If at all possible I’d prefer to avoid introducing an additional flyctl step after terraform apply.
Unfortunately an app needs to exist before you can push to it’s repo. However you can deploy from another app’s repo in the same org. Would it work to first push to another app’s repo then create the app?
I might be able to make it work. Is it possible to use a single app for all images you want to push for any other app you might deploy in the organization?
One other thing you can consider is just stubbing out the app with createApp before you deploy. This will let you “stage” secrets and other configuration options, push to the registry, and then deploy separately.