Skip to main content

Pulumi Native Provider for Fly Machines

Fly.io runs your apps close to your users on fast-booting VMs. The Machines API gives you low-level control over Fly Apps, Machines, volumes, IP assignments, secrets and more.

This provider was generated using pulschema and pulumi-provider-framework.

Package SDKs

Using The Provider

You'll need a Fly.io API token. Follow Fly's docs for creating one, for example with fly tokens create org. Then set the token as a secret with pulumi config set --secret fly-machines:apiKey <token>. Alternatively, set the FLY_MACHINES_APIKEY environment variable. The provider sends the token as a Bearer token.

import * as pulumi from "@pulumi/pulumi";
import * as fly from "@cloudyskysoftware/pulumi-fly-machines";

const config = new pulumi.Config();
const orgSlug = config.require("orgSlug");

const app = new fly.apps.v1.App("myapp", {
  name: "my-fly-app",
  orgSlug,
});

const ip = new fly.apps.v1.AppIPAssignment("app-ip", {
  appName: app.name,
  type: "shared_v4",
});

const machine = new fly.apps.v1.Machine(
  "myapp-machine",
  {
    appName: app.name,
    config: {
      image: "flyio/hellofly:latest",
      services: [
        {
          ports: [
            { port: 443, handlers: ["tls", "http"] },
            { port: 80, handlers: ["http"] },
          ],
          protocol: "tcp",
          internalPort: 8080,
        },
      ],
    },
  },
  { dependsOn: ip },
);

export const appUrl = pulumi.interpolate`https://${app.name}.fly.dev`;

See examples/simple for the full example, including how to use MachinesMetadataKey resources to make API-created machines visible to flyctl.

Importing Existing Resources

Import IDs should satisfy all ID segments in the GET endpoint for the resource you are importing. The IDs required in the path should be separated by /. Locate the GET endpoint in the OpenAPI spec.

For example, to read a machine, the path in the OpenAPI spec is: GET /v1/apps/{app_name}/machines/{machine_id}.

Thus, the pulumi import command to run is:

# The type fly-machines:apps/v1:Machine can be easily found by using your IDEs
# Go To Definition functionality for the resource and looking at the type
# property defined in the custom resource's class definition.
pulumi import fly-machines:apps/v1:Machine {resourceName} /{app_name}/{machine_id}

Alternatively, you can also import using the import Pulumi resource option. Run pulumi up to import the resource into your stack's state. Once imported, you should remove the import resource option.

const myMachine = new fly.apps.v1.Machine(
  "myMachine",
  { appName: "my-app", config: { image: "flyio/hellofly:latest" } },
  {
    protect: true,
    import: `/my-app/<machine-id>`,
  },
);

Refer to the Pulumi docs for importing a resource.

Releasing A New Version

:info: Switch to the main branch first and get the latest git pull origin main && git fetch. Check what the last release tag was.

  1. Regular releases should just increment the patch version unless a minor or a major (breaking changes) version bump is warranted.

  2. Update the CHANGELOG.md with notes about what will be included in this release.

  3. Commit the changelog with git commit -am "vX.Y.Z" or something similar and push git push origin main.

  4. Tag the commit with the release version by running

    git tag vX.Y.Z
    git tag sdk/vX.Y.Z
    
  5. Push the tags.

    git push --tags
    

Metadata

Release files for pulumi-fly-machines 0.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pulumi-fly-machines 0.0.11
File Size Uploaded Provenance
pulumi_fly_machines-0.0.11.tar.gz 126.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pulumi-fly-machines 0.0.11
File Interpreter ABI Platform
pulumi_fly_machines-0.0.11-py3-none-any.whl Python 3 none any Details

Total release size: 363.3 kB

Release files / pulumi_fly_machines-0.0.11.tar.gz

Download URL pulumi_fly_machines-0.0.11.tar.gz
Size 126.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9870cf5a0fa4873b37b6353b8ed70bbddc62173c7defac73a8cc2fb53c61ef78
BLAKE2b-256 checksum
How to use checksums
d3911e8f475209eddedcb46dd7b8fe0843070bb669be36f8b39ad61d3745c9c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / pulumi_fly_machines-0.0.11-py3-none-any.whl

Download URL pulumi_fly_machines-0.0.11-py3-none-any.whl
Size 236.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61fd6bc6b0a589aa3a7d88d6089c892d8d80e92c612f00cdda35f05df60a9da3
BLAKE2b-256 checksum
How to use checksums
6aca517acace1ba9fdb4559edc9486b028a52ccc592ecea4733638cc48bc3f78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Security for pulumi-fly-machines 0.0.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pulumi_fly_machines-0.0.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page