The Fly.io provider deploys Ctrl Plane instances as Fly Machines, giving you global edge deployment with automatic placement close to users.
Status01
Interface defined — the package structure exists at provider/fly and implements the provider.Provider interface. Full implementation is in progress.
Configuration02
import "github.com/xraph/ctrlplane/provider/fly"
prov, err := fly.New(fly.Config{
Token: os.Getenv("FLY_API_TOKEN"),
OrgSlug: "my-org",
Region: "iad",
})| Field | Env | Default | Description |
Token | CP_FLY_TOKEN | — | Fly.io API token |
OrgSlug | CP_FLY_ORG | — | Organization slug |
Region | CP_FLY_REGION | — | Primary region (e.g., iad, lhr, nrt) |
AppPrefix | CP_FLY_APP_PREFIX | cp | Prefix for Fly app names |
Capabilities03
| Capability | Supported |
provision | Yes |
deploy | Yes |
scale | Yes |
logs | Yes |
exec | Via SSH |
custom_domains | Yes |
tls | Yes (automatic) |
rolling | Yes |
blue_green | Yes |
Resource mapping04
| Ctrl Plane concept | Fly.io resource |
| Instance | Fly App + Machine |
| Environment variables | Machine env / Fly Secrets |
| Ports | Service ports in fly.toml |
| Resources (CPU/Memory) | Machine guest config |
| Custom domains | Fly certificate + CNAME |
| TLS certificates | Automatic via Fly |
| Health checks | Machine HTTP checks |
How it works05
Provision creates a Fly App and an initial Machine in the configured region.
Deploy updates the Machine image and restarts it. For blue-green, a new Machine is created before the old one is stopped.
Scale adjusts the Machine guest configuration (CPU, memory) or adds machines in additional regions.
Custom domains are added via the Fly certificates API with automatic TLS.
Logs are streamed from the Fly Logs API.
When to use06
Applications that need global edge distribution
Latency-sensitive workloads deployed close to end users
Projects that want automatic TLS and custom domain management
Rapid prototyping with simple deployment workflows