Skip to content

Fly Machines

The Fly Machines lexicon defines Fly.io apps and machines using chant’s declarative TypeScript syntax. Resources are serialized to the JSON create bodies the Machines API (“flaps”) accepts, so the applier can POST them straight through and the mudflaps emulator can round-trip them offline.

This lexicon is generated from Fly’s published Machines API OpenAPI spec.

Install it with:

Terminal window
npm install --save-dev @intentius/chant-lexicon-fly
import { App, Machine, MachineConfig, MachineGuest, Fly } from "@intentius/chant-lexicon-fly";
const app = new App({ name: "my-app", org_slug: Fly.OrgSlug });
const web = new Machine({
name: "web",
region: Fly.Region,
config: new MachineConfig({
image: "flyio/hellofly:latest",
guest: new MachineGuest({ cpu_kind: "shared", cpus: 1, memory_mb: 256 }),
}),
});
export { app, web };

Fly.Region and Fly.OrgSlug are pseudo-parameters resolved from the environment at build time (FLY_REGION, FLY_ORG / FLY_ORG_SLUG).

MetricCount
Resources6
Property types35
Services5
Intrinsic functions0
Pseudo-parameters0
Lint rules5

Lexicon version: 0.0.1
Namespace: fly