Chapter 35 - Terraform Cloud - CLI Driven Workflow
Using Terraform Cloud in the CLI
You can use Terraform Cloud in the CLI, using the features of Terraform Cloud's backend and workspaces.
# Terraform Block
terraform {
required_version = ">= 1.0.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 2.0"
}
}
# Update Terraform Cloud Backend Block Information below
backend "remote" {
organization = "dupo-internal"
workspaces {
name = "dupos-terraform"
}
}
}
# Provider Block
provider "azurerm" {
features {}
}
May need a token during this process if not logged into Terraform Cloud.
Configuring AZ Env Variables in TF Workspace
-
Add the Environment Variables in Terraform Cloud
-
Run the
terraform plan
in the CLI with the environment variables
Terraform plan
's aren't permanently shown in the runs. but the terraform apply
is.