If you are currently working with Terraform Cloud remote backend and would like to use env zero with this setup you will need to do the following: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.
- Local execution mode - First you need to change the workspace settings in Terraform Cloud to enable local runs, so you need to go to the
General Settingsof the workspace and change theExecution Modeto Local. - Generating a token for authentication - To authenticate to Terraform Cloud remote backend you need to generate an API token, so under the
User settingsunderTokensand create an API token. Please save the token, we will need it in the further steps. - If you are running terraform version 1.2.0 or up you will need to add the following environment variables:
| Variable Name | Value |
|---|---|
TF_TOKEN_app_terraform_io | The API token you’ve created in Terraform Cloud |
ENV0_SKIP_WORKSPACE | true |
- If not you will need to add an
env0.ymlfile - In your Terraform git repo you will need to add anenv0.ymlfile in the Terraform folder and add the following code:
| Variable Name | Value |
|---|---|
TF_CLOUD_TOKEN | The API token you’ve created in Terraform Cloud |
ENV0_SKIP_WORKSPACE | true |
- Now you are ready to run your Template and the remote backend should be stored in Terraform Cloud.
Suggested Blog Content
Terraform Modules Guide Terraform Plan Examples Managing Terraform Variable Hierarchy Manage Terraform Remote State with a Remote BackendNext steps
- Running Remote Plan - Run plan locally while executing remotely in env zero.
- Running Remote Apply - Apply local changes remotely with an auditable deployment record.
- Migrate from Terraform Cloud - Follow the guided migration wizard to move off Terraform Cloud.