By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Terraform Cloud (TFC) and Terraform Enterprise (TFE) are managed services that provide collaboration, governance, and automation for Terraform workflows. Workspaces are the core unit of organization—they map to environments (dev, staging, prod) or components (networking, databases). VCS-driven plans (Version Control System) automate Terraform runs when code is pushed to a repo (GitHub, GitLab, Bitbucket).
terraform apply
terraform.tfstate
You’re a cloud engineer at a fintech startup. Your team uses Terraform to manage AWS infrastructure, but: - Developers keep breaking staging by running terraform apply locally. - Prod deployments require manual approvals, but there’s no record of who approved what. - Someone accidentally deleted an S3 bucket in prod, and you have no way to track who did it.
Solution: Migrate to Terraform Cloud, set up workspaces for each environment, and enforce VCS-driven plans with approval gates.
aws_region = "us-east-1"
aws_instance
vpc
eks
✅ Terraform Cloud account (sign up here) ✅ GitHub/GitLab/Bitbucket repo with Terraform code ✅ AWS credentials (or other cloud provider) stored as TFC variables
my-org/terraform-aws-infra
aws-prod-networking
/terraform/networking
main
prod
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
aws_region
[email protected]
dev-team
ops-team
hcl # Example: Assume an IAM role in Terraform provider "aws" { assume_role { role_arn = "arn:aws:iam::123456789012:role/terraform-cloud-role" } }
t3.micro
m5.large
user_data
hcl resource "aws_instance" "dev" { user_data = <<-EOF #!/bin/bash shutdown -h 20:00 EOF }
<cloud>-<env>-<component>
Environment
Owner
CostCenter
hcl resource "aws_instance" "web" { tags = { Environment = "prod" Owner = "team-infra" } }
❌ Drift Detection
"You need to deploy a change to prod but require approval. Which TFC setting should you configure?"
❌ VCS branch protection
"What happens if you push a Terraform change to a repo connected to TFC with auto-apply enabled?"
terraform plan
⚠️ One workspace per environment—don’t mix them!
Auto-apply vs. Manual apply:
Manual apply: Required for prod (safety first).
VCS Integration:
You have a GitHub repo (my-org/terraform-aws) with Terraform code for an S3 bucket. Configure TFC to: 1. Auto-apply changes in dev (branch: dev).2. Require manual approval in prod (branch: main).3. Use a variable set for aws_region = "us-east-1".
my-org/terraform-aws
dev
aws-dev-s3
aws-prod-s3
Why It Works:- Workspaces isolate environments (no cross-contamination).- Variable sets avoid duplication (DRY principle).- Approval gates prevent prod outages.
terraform login
terraform login terraform.io
Settings → Workspaces → New Workspace
Settings → Version Control
Workspace Settings → Run Triggers
Settings → Variable Sets
Workspace Settings → General
Settings → Policy Sets
Registry → Modules
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.