Your platform team uses Terraform to provision multiple Google Cloud projects. You need a shared Terraform state solution that
keeps a full history so you can roll back to any previous version,
prevents two engineers from accidentally updating the same state file at the same time, and
relies only on Google-managed services you already use. Which approach should you recommend?
Use the s3 backend pointed at an interoperability-enabled Cloud Storage bucket and add a DynamoDB table to provide state locking.
Configure the gcs backend to store state in a Cloud Storage bucket that has object versioning enabled; the backend uses Cloud Storage generation numbers to lock the state during Terraform operations.
Keep the default local backend and commit the terraform.tfstate file to Cloud Source Repositories, relying on Git history for version control.
Migrate to Terraform Cloud and use its remote backend to obtain state versioning and locking features.
The gcs backend stores the Terraform state file in a Cloud Storage bucket. When bucket object versioning is enabled, each change to the state produces a new object generation that can be restored if needed. During a plan or apply, the gcs backend automatically uses Cloud Storage precondition checks (generation numbers) to obtain an exclusive state lock, preventing concurrent writes without requiring additional services. Local backends offer no locking or history, the s3 backend with DynamoDB locking is designed for AWS, and Terraform Cloud introduces an external service rather than relying only on Google-managed infrastructure.
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 is Terraform state and why is it important?
Open an interactive chat with Bash
What does object versioning in Cloud Storage do?
Open an interactive chat with Bash
How do Google-managed services ensure Terraform state locking?
Open an interactive chat with Bash
What is Terraform remote state?
Open an interactive chat with Bash
How does object versioning work in Cloud Storage?
Open an interactive chat with Bash
What is state locking and how does GCS handle it for Terraform?
Open an interactive chat with Bash
GCP Associate Cloud Engineer
Planning and implementing a cloud solution
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
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .