- You have a login token
- The current path is the directory of the Terraform stack
- The Terraform stack defines a properly configured env zero backend
backend.tf
PROJECT_ID in the backend configurationThe PROJECT_ID is only required if the env zero environment does not exist in the env zero UI. If this is the first time you are creating an env zero environment with the remote backend configuration, specify the PROJECT_ID so env zero knows which project to place it in. If you are updating the backend configuration for an existing environment, you do not need to specify the PROJECT_ID.
- Run
terraform login backend.api.env0.com - Enter
yeswhen prompted - Insert your
token
Module registry and remote backend use separate endpointsThe module registry and remote backend are hosted on different API endpoints. To use both with the same API key, you must also set up the token for
api.env0.com. See Private Registry authorization for details.Generating a token
To generate a token, create a Personal API key. After the API key is created, the token appears under Using it locally for Remote Backend. Admins can also create an API key with a specific role.Logout
To log out, navigate tobackend.api.env0.com/logout/{Token} in your browser.
Next steps
- Running remote plan - Run Terraform plans remotely via env zero after logging in.
- Running remote apply - Apply Terraform changes remotely through env zero.
- User API keys - Generate and manage the API keys used for authentication.