Skip to main content
Pulumi is an infrastructure-as-code framework that harnesses popular programming languages such as Go, JS/TS, Python, and .NET Platform. With env zero, you can enjoy all of the benefits that are built on top of it such as Plan on Pull Request, Drift Detection, and moreโ€ฆ Unlike the HCL language that is used in terraform, Pulumi represents the concept of writing IaC by commonly used programming languages. There are many benefits of such concept, for example, strong-type support, homogeneous codebase, testing easiness, etc. You can read more about Pulumi in their docs.

Environment Deployment

In order to manage your Pulumi executions in env zero, you may have to follow the next steps:
  1. Create a Pulumi Template first.
  2. Create env0.yml file in the target repository and inject a required packages installation command
    (npm i for example, see gist).
  3. Connect your cloud account
  4. Add PULUMI_ACCESS_TOKEN environment variable
  5. Create an environment, you can set the stack name if you already configured one, if not, env zero will create a random stack name.
State StorageCurrently, env zero does not store the stack state, which means that it is saved in Pulumiโ€™s remote backend or using a Pulumi self-managed option. See Pulumi Docs on State Storage for more details.

Execution Steps

Beyond the common steps such as Clone, Loading variables, etc. Deploy/Destroy Pulumi environment contains the following steps:
  1. Pulumi Login - pulumi login --non-interactive
  2. Stack Selection - pulumi stack select --create <stack_name>
  3. Pulumi Preview - pulumi preview --refresh --diff --show-replacement-steps
  4. Pulumi Up - pulumi up -f --yes --refresh --diff --show-replacement-steps
  5. Pulumi Stack Output
  6. Pulumi Destroy - pulumi destroy -f --yes --refresh --diff --show-replacement-steps

Additional Configuration

Check out Pulumiโ€™s Environment Variable configurations to further customize your environment For example, if you want to use your own S3 remote backend, simply create an Environment Variable in your env zero Environment with PULUMI_BACKEND_URL=s3://your-pulumi-state-bucket
โŒ˜I