Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.envzero.com/llms.txt

Use this file to discover all available pages before exploring further.

This step assumes you have already connected your cloud account.
Templates are how you add your infrastructure code to env zero. You need to tell env zero how to connect to your VCS and where to find your IaC code.
If you don’t have a repository yet, fork env0/templates. For a simple starting point, try the aws/simple-ec2 example (AWS) or another example that matches your cloud provider. Each folder has a README that lists what it deploys and which variables it requires.

Create your template

  1. Open the Organization Templates page.
Organization templates page link
  1. Click Create New Template.
Create new template button
  1. Choose your desired template type. Select Terraform for Terraform code or OpenTofu for OpenTofu code. For other frameworks, select the matching tile.
  2. Enter a name for your template in Template Name. If the form shows a version selector, choose the IaC version your code requires. If you’re unsure, select the latest stable version. Click Next.
Template creation form showing Template Name field and IaC type selection
  1. Select your VCS provider. Follow the section below for your provider.
IaC folder path: Each VCS section below asks for a folder (Terraform Folder, Pulumi Root, etc.). This must be the exact path to your IaC files relative to the repository root, such as terraform/ or infra/prod. Leave it empty only if your IaC files are at the repository root. An incorrect path causes a “no configuration files” error during the first deployment.
VCS provider selection showing Github.com, Gitlab.com, Bitbucket.org, Azure DevOps, and Other VCS options

GitHub

Installing the env zero GitHub App requires admin access to your GitHub organization. If you don’t have admin rights, ask your GitHub org admin to install it before continuing.
  1. After clicking the GitHub.com button for the first time, a GitHub popup asks you to install the env zero GitHub App on a GitHub organization. Pick the GitHub organization containing your repository.
GitHub organization selection popup
  1. Pick the repositories you want env zero to have access to and install the GitHub App.
GitHub repository selection interface
  1. The GitHub popup closes.
  2. Pick the GitHub repository that contains the code for this template.
If your repository doesn’t appear in the picker, it wasn’t included when you installed the GitHub App. Go to your GitHub organization settings, find the env zero App, and click Configure to add the repository.
  1. Enter a branch or tag in the Branch field. Leaving this empty uses your default branch (usually main or master).
  2. Enter the folder your IaC files are in. The field name varies by template type (Terraform Folder, Pulumi Root, etc.) but works the same way. Leave empty if the files are at the repository root.
  3. Click Next to continue to Variables.
GitHub VCS configuration showing repository picker, Branch field, and Terraform Folder input

GitLab

OAuth

  1. After clicking the GitLab.com button for the first time, a GitLab popup asks you to authorize the env zero application to access your repositories.
GitLab OAuth authorization popup asking to grant the env zero application access to repositories
  1. The GitLab popup closes.
  2. Pick the GitLab repository that contains the code for this template.
  3. Enter a branch or tag in the Branch field. Leaving this empty uses your default branch (usually main or master).
  4. Enter the folder your IaC files are in. The field name varies by template type (Terraform Folder, Pulumi Root, etc.) but works the same way. Leave empty if the files are at the repository root.
  5. Click Next to continue to Variables.

GitLab Access Token

  1. After selecting GitLab.com, a radio button appears with two options.
  2. Click Access Token and either select an existing token or create a new one.
    1. Creating a token:
      1. The token can be either a Personal Access Token or a Group Access Token.
      2. The token must have access to each repository you want to use with env zero. Each project’s user must have at least Maintainer or Owner permissions.
      3. The token must have the read_repository and api scopes.
  3. Follow the same steps from step 3 in the OAuth section above.
GitLab Access Token configuration showing token input and repository selection

Bitbucket

  1. After clicking the Bitbucket.org button for the first time, a Bitbucket popup asks you to authorize the env zero application to access your workspace.
Bitbucket OAuth authorization popup asking to grant the env zero application access to workspace
  1. The Bitbucket popup closes.
  2. Pick the Bitbucket repository that contains the code for this template.
  3. Enter a branch or tag in the Branch field. Leaving this empty uses your default branch (usually main or master).
  4. Enter the folder your IaC files are in. The field name varies by template type (Terraform Folder, Pulumi Root, etc.) but works the same way. Leave empty if the files are at the repository root.
  5. Click Next to continue to Variables.

Azure DevOps

  1. After clicking the Azure DevOps button for the first time, an Azure DevOps popup asks you to authorize the env zero application to access your repositories. Grant access for the app.
Azure DevOps OAuth authorization popup asking to grant the env zero application access to repositories
  1. The Azure DevOps popup closes.
  2. Pick the Azure DevOps repository that contains the code for this template.
  3. Enter a branch in the Branch field. Leaving this empty uses your default branch (usually main or master).
  4. Enter the folder your IaC files are in under <IaC> Folder (where IaC is the template type you selected). Leave empty if the files are at the repository root.
  5. Click Next to continue to Variables.
Enable third-party app access in Azure DevOpsYou must enable Third-party application access via OAuth under Organization Settings > Security > Policies for any organization you want to manage repositories for.

Other VCS

  1. Enter the URL to your IaC repository under Repository URL. The URL can be HTTP/S or SSH.
  2. Enter a branch or tag in the Branch field. Leaving this empty uses your default branch.
  3. Enter the folder your IaC files are in under Terraform Folder. Leave empty if the files are at the repository root.
  4. If your repository is private, use the SSH Keys or Git Token dropdown to select the credentials you created in the Connect Your Git Repository step.
  5. Click Next to continue to Variables.
Other VCS configuration showing Repository URL field, Branch field, and SSH Keys dropdown

Variables

Variables step showing Terraform Variables table, Environment Variables table, and Variable Set Assignments section, each with an Add Variable button
  1. Add the variables your template needs at deploy time.
    • Terraform Variables are passed to the IaC tool as -var flags. Use these for values your code declares as variable blocks, such as region, instance_type, or environment_name.
    • Environment Variables are set in the shell before the IaC tool runs. Use these for provider authentication, such as AWS_ACCESS_KEY_ID, GOOGLE_CREDENTIALS, or tool configuration flags.
    See Variables for full scoping rules and inheritance. If your template doesn’t require any variables yet, skip this step.
Mark any variable containing a secret (passwords, API keys, tokens) as Sensitive using the lock icon. Sensitive variables are encrypted at rest and redacted from deployment logs. Non-sensitive values appear in plain text in logs and are visible to anyone with access to the environment.
  1. Click Next to continue to Projects.

Projects

  1. Pick the projects that you’d like to allow to deploy this template.
  2. Click Done to create the template.
Template Projects step showing project checkboxes for associating the template

Add your template to a project

To run the template, add it to one of the organization’s projects. Your new organization already has a Default Project.
  1. Go to the Default Organization Project.
  2. Click Project Templates in the left menu.
Project templates page navigation
  1. Click Manage Templates and check the checkbox next to the template you created.
Project template management interface showing template checkbox selection
  1. Click Save.

Next steps