Skip to main content
Templates are the way to add your Terraform code to env zero. You will need to tell env zero how to connect to your VCS, and where to find your Terraform code.

Create Your Template

  1. Open the Organization Templates page
Organization templates page link

Link to Organization Templates

  1. Click on Create new template
Create new template button

Create New Template

  1. Choose your desired template type
  2. Enter a name for your template in Template Name, and then click on NEXT
  1. Please follow the next sections per your VCS integration:

GitHub

  1. After clicking on “GitHub.com” button for the first time, you will get a popup from GitHub asking you to install the env zero GitHub App on a GitHub organization. Pick the GitHub organization containing your Terraform repository.
GitHub organization selection popup

Pick GitHub Organization

  1. Pick the repositories you want env zero GitHub App to have access to, and install the GitHub App
GitHub repository selection interface

Pick GitHub Repositories

  1. The popup GitHub window will close.
  2. Pick the GitHub repository that contains the code for this template
  3. If you would like to pull the code from a specific revision or branch, enter that in the Revision field. Leaving this field empty will use your default branch, which is usually “master”/“main”.
  4. Enter the folder your IaC files are located in under Terraform Folder or Terragrunt Folder. If your IaC files are in the root of the repository, leave this empty.
  5. Click on NEXT to go to the next step, Variables

GitLab

OAuth

  1. After clicking on the “GitLab.com” button for the first time, you will get a popup from GitLab asking you to authorize the env zero GitLab application access to your repositories using your account.
  1. The GitLab popup will close.
  2. Pick the GitLab repository that contains the code for this template
  3. If you would like to pull the code from a specific revision or branch, enter that in the Revision field. Leaving this field empty will use your default branch, which is usually “master”/“main”.
  4. Enter the folder your IaC files are located in under Terraform Folder or Terragrunt Folder. If your IaC files are in the root of the repository, leave this empty.
  5. Click on NEXT to go to the next step, Variables

GitLab Access Token

  1. After selecting “GitLab.com” a double-options radio button will be shown
  2. Click on 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 would like to be able to use with env zero. For each project, the user should have at least Maintainer/Owner permissions.
      3. The token must have the “read_repository” and “api” scopes defined.
  3. Follow the same steps from step 3, listed above in the OAuth section.

Bitbucket

  1. After clicking on the “Bitbucket.org” button for the first time, you will get a popup from Bitbucket asking you to authorize the env zero Bitbucket application access to your workspace using your account.
  1. The Bitbucket popup will close.
  2. Pick the Bitbucket repository that contains the code for this template.
  3. If you would like to pull the code from a specific revision or branch, enter that in the Revision field. Leaving this field empty will use your default branch, which is usually “master”/“main”.
  4. Enter the repository sub-folder your IaC files are located in under Terraform Folder or Terragrunt Folder. If your IaC files are in the root of the repository, leave this empty.
  5. Click on NEXT to go to the next step, Variables

Azure DevOps

  1. After clicking on “Azure DevOps” button for the first time, you will get a popup from Azure DevOps asking you to authorize the env zero Azure DevOps application access to your repositories using your account. Grant access for the app.
  1. The Azure DevOps popup will close.
  2. Pick the Azure DevOps repository that contains the code for this template
  3. If you would like to pull the code from a specific revision or branch, enter that in the Branch field. Leaving this field empty will use your default branch, which is usually “master”/“main”.
  4. Enter the folder your IaC files are located in under <IaC> Folder (IaC being the template type you chose earlier). If your IaC files are in the root of the repository, leave this empty.
  5. Click on NEXT to go to the next step, Variables
NoticeYou must enable the Third-party application access via OAuth under Organization Settings/Security/Policies for any organization you wish to manage repositories for

Other VCS

  1. Enter the URL to your Terraform repository that contains the code for this template under “Repository URL” - The URL can either be an HTTP/S URL or an SSH URL
  2. If you would like to pull the code from a specific revision or branch, enter that in the Revision field. Leaving this field empty will use your default branch, which is usually “master”/“main”.
  3. Enter the folder your Terraform files are located in under Terraform Folder. If your Terraform files are in the root of the repository, leave this empty.
  4. If your repository is private - use the SSH Keys or Git Token dropdown, to select the keys/tokens you created in the Connecting your VCS stage.
  5. Click on NEXT to go to the next step, Variables

Variables

  1. In the variables section, you can now enter environment variables and terraform variables that will be used when deploying this template. For more info Variables
  2. When you’re done adding variables, click on NEXT to go to the final step, Projects

Projects

  1. Pick the projects that you’d like to allow to deploy this template.
  2. Click on DONE when you’re done to create the template.

Add Your Template To a Project

In order to run the template, you’ll need to add it to one of the organization’s Projects. Your new organization will already have a Default Project.
  1. Go to the Default Organization Project
Project template creation interface showing template configuration options
  1. Click the Project Templates page in the left menu.
Project templates page navigation
  1. Click Manage and check the checkbox next to the template you’ve created.
Project template management interface
  1. Click Save