Terraform Cloud Remote Backend
Terrateam Configuration
Terrateam behavior can be configured via a config.yml
. This file is located in
a directory named .terrateam
at the root of your Terraform repository:
.terrateam/config.yml
.
See Configuration documentation for details.
It’s possible to use Terraform Cloud as a remote backend to store and manage state files.
Terraform Cloud Token
Terrateam needs a Terraform Cloud user API token in order to authenticate against the Terraform Cloud remote backend.
- Navigate to the Tokens
section of the
Terraform Cloud
Console
- Select
Create an API token
- Choose a
Description
and selectCreate API token
- Save your token in a safe place as it will not be displayed again
Workspace Configuration
Terrateam can work with existing Terraform Cloud workspaces or a newly created workspace.
New Workspace Configuration
- Select
Workspaces
in the Terraform Cloud Console
- Select
New workspace
in the top right corner
- Select
CLI-driven workflow
- Choose a
workspace name
anddescription
and selectCreate workspace
- Navigate to
Settings
- Set
Execution Mode
toLocal
and selectSave settings
Existing Workspace Configuration
- Select your existing workspace in the Terraform Cloud Console
- Navigate to
Settings
- Set
Execution Mode
toLocal
and selectSave settings
Granting Terrateam Access
- Navigate to the main page of your Terraform repository on GitHub and select
Settings
- In the left sidebar, select
Secrets
→Actions
- Select
New repository secret
- Populate the
Name
andSecret
fields and selectAdd secret
- Name:
TF_API_TOKEN
- Value:
<Terraform-Cloud-API-Token>
Backend Provider Example
Basic configuration to start using Terraform Cloud as a remote backend:
terraform {
backend "remote" {
hostname = "app.terraform.io"
organization = "<your-terraform-cloud-organization>"
workspaces {
name = "production"
}
}
}