GCP Professional Cloud Architect Practice Question
Your team maintains a single Git repository that defines a standardized VPC landing zone using Terraform. Security mandates that the dev, staging, and prod environments must all use identical configuration logic without code duplication, must keep completely separate Terraform state files and IAM permissions, and must be promoted independently through their own CI/CD pipelines. Which Terraform feature provides the most straightforward way to satisfy these requirements while re-using the same configuration across all environments?
Parameterize the environment in variables and use a single backend so all environments share one remote state file.
Wrap the VPC code in a Terraform local-exec provisioner that calls gcloud with different projects for each environment.
Rewrite the configuration as a Google Cloud Deployment Manager composite type and deploy it three times.
Create a dedicated Terraform workspace for each environment and configure the backend to store state in environment-specific Cloud Storage prefixes.
Terraform workspaces let you run the same configuration many times while automatically isolating the state of each run. By creating a dev, staging, and prod workspace, the team re-uses one codebase but stores a distinct state file per workspace (backed by separate IAM-restricted Cloud Storage buckets or prefixes). This prevents cross-environment dependencies and aligns with independent pipelines.
Modules with environment variables or local-exec provisioners still require manual state segregation and add risk. A single shared backend would violate isolation and governance requirements.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What are Terraform Workspaces?
Open an interactive chat with Bash
Why is it important to isolate state files using separate Terraform Workspaces?
Open an interactive chat with Bash
How does Terraform handle backend configuration for workspace-specific state files?
Open an interactive chat with Bash
What are Terraform workspaces and how do they help in managing multiple environments?
Open an interactive chat with Bash
How does Terraform backend configuration ensure state isolation among environments?
Open an interactive chat with Bash
Why is code duplication avoided when using Terraform workspaces?
Open an interactive chat with Bash
GCP Professional Cloud Architect
Managing and provisioning a solution infrastructure
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .