1. Packages
  2. Defang Provider
  3. Installation & Configuration
defang v1.0.0 published on Monday, Mar 24, 2025 by Defang

Defang Provider: Installation & Configuration

Installation

The Pulumi Provider for Defang — Take your app from Docker Compose to a secure and scalable cloud deployment with Pulumi.

The Defang Pulumi Provider is available in most pulumi languages.

Installing the Pulumi Plugin directly

pulumi plugin install resource defang --server github://api.github.com/DefangLabs

Authentication

Authenticating with Defang

Sign up for Defang with your Github account.

Authenticating in Github Actions workflows

When run in a Github Actions workflow, the Defang Pulumi Provider will automatically use environment varialbes Github providew to authenticate your Github user with Defang if you give your workflow the appropriate permissions. Defang use the ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN env vars.

Authenticating with defang token

You can run defang token --expires 30d out of band with a reasonable duration and you can store the result in DEFANG_ACCESS_TOKEN.

Authenticating with your cloud provider

You will also need to authenticate with your cloud provider.

  • For AWS, there are many ways to authenticate
  • For Digital Ocean, you will need to set the following env vars:
    • DIGITALOCEAN_TOKEN
    • SPACES_ACCESS_KEY_ID
    • SPACES_SECRET_ACCESS_KEY
  • For Google Cloud, you may wish to use the google-github-actions/auth Github Action

Using Pulumi Cloud

Defang runs the Pulumi CLI in your cloud account. You can use Pulumi Cloud to manage the Pulumi resources which Defang creates by setting the following environment variables:

  • DEFANG_PULUMI_BACKEND=pulumi-cloud
  • PULUMI_ACCESS_TOKEN

Reference

For detailed reference documentation, please visit the Pulumi registry.