Skip to main content

Editions, Install & Auth

Exam guide§2.4

Before running any Terraform, three setup questions: which edition to use, how to install it, and how it authenticates to Google Cloud. With these settled, the workflow and commands page is where you actually drive it.

Editions

Terraform ships in three editions. Community Edition is free and CLI-only; Cloud and Enterprise add a GUI and concurrent deployments.

ManagedProsConsTerraformCommunityEdition• Deployed on a local machine or computeresource in the cloud• No license cost• Use public registry within your code• Does not support concurrentdeployments• Only interfaced through CLITerraformCloud• SaaS based version• Small operational overhead• Comes with three plans• Supports concurrent deployments• Can be accessed through GUI and CLI• License cost for advanced featuresTerraformEnterprise• Private implementation• Supports concurrent deployments• Secure deployment• Can be accessed through GUI and CLI• Infrastructure and license costs• Large operational overhead
Terraform editions: Community Edition is free and CLI-only; Cloud is a low-overhead SaaS; Enterprise is self-hosted with high overhead
FactsCommunity Edition: local-only, CLI-only, no version control

Community Edition runs only on your local machine, is driven only through the CLI (no GUI), and does not support concurrent deployments. It also has no built-in version control, so it cannot track changes or guarantee your commits do not drift the infrastructure. Cloud and Enterprise remove these limits. Enterprise is self-hosted, so it carries high operational overhead; Cloud is SaaS, so its overhead is low.

Installing Terraform

Install Terraform on your local machine as a binary package or via a package manager. Manual install on Windows:

NumbersManual install (Windows)
  1. Download the package that meets your system requirements.
  2. Extract the package - Terraform is a single binary called terraform.
  3. Edit the PATH variable to include Terraform.
  4. Verify with terraform -help in a new terminal.
GotchaCloud Shell no longer ships Terraform pre-installed

The course materials say Terraform is pre-installed on Cloud Shell, but it is not anymore - and a plain install does not survive a new session (Cloud Shell rebuilds the VM). Install it from the HashiCorp apt repo inside ~/.customize_environment so the install re-runs on every session start:

cat <<'EOF' > ~/.customize_environment
wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install -y terraform
EOF
bash ~/.customize_environment

Authenticating to Google Cloud

The authentication mechanism depends on where Terraform runs. It is the Google Cloud provider - not Terraform itself - that authenticates to the resource APIs to create resources.

On yourworkstationAuthenticate Terraformusing Google Cloud SDK.On Cloud Shell, it ispre-authenticated for you.In a VM onGoogle CloudConfigure the VMto use a Google ServiceAccount.OutsideGoogle CloudUsing workload identityfederation, generate aservice account key andset environment variables.
Terraform authentication to Google Cloud varies by where it runs: on your workstation, in a VM on Google Cloud, or outside Google Cloud
Best practiceService account keys are the weakest option

When Terraform runs outside Google Cloud, supply a downloaded JSON key via the GOOGLE_APPLICATION_CREDENTIALS environment variable. But keys are long-lived and cannot be rotated automatically, and must be protected. Prefer workload identity and workload identity federation, which mint short-lived tokens and avoid a stored key file entirely.