Your company is moving its Terraform workflows to Google Cloud. Several engineers in different regions will run terraform apply against the same infrastructure code. Security mandates that the state file must be encrypted at rest, previous versions must be recoverable if someone deletes or corrupts the file, and simultaneous runs must not corrupt the state. Which approach best satisfies all requirements with minimal operational overhead?
Provision a Filestore share mounted over VPN from engineer laptops and point the Terraform local backend path to that shared directory.
Keep the local backend and commit the state file to Cloud Source Repositories after every apply so that Git history preserves older versions.
Store the state file as a secret in Secret Manager, keep using the local backend, and grant engineers Secret Manager access via IAM.
Create a regional Cloud Storage bucket dedicated to Terraform state, enable object versioning and a locked retention policy, enforce uniform bucket-level access, and configure the Terraform gcs backend to use this bucket.
A Cloud Storage bucket used with the Terraform gcs backend provides highly available remote state and automatically handles state locking by using object generation preconditions. Enabling object versioning ensures that earlier state files can be recovered, and a retention policy locked through Bucket Lock prevents accidental or malicious deletion within the defined period. Cloud Storage encrypts all data at rest automatically (and can optionally use CMEK), so the solution meets encryption, recovery, and concurrency requirements without additional services. Secret Manager, source-controlled local state, or Filestore shares either do not provide automatic locking, easy version recovery, or both.
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.
Why is the Terraform gcs backend preferred for storing state files in Google Cloud?
Open an interactive chat with Bash
What is object versioning and why is it important in the Terraform gcs backend?
Open an interactive chat with Bash
How does Cloud Storage ensure encryption and prevent data loss?
Open an interactive chat with Bash
Why is object versioning important in Terraform workflows?
Open an interactive chat with Bash
How does the Terraform gcs backend ensure simultaneous runs don't corrupt the state?
Open an interactive chat with Bash
What is CMEK in Google Cloud Storage, and when should it be used with Terraform state?
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 $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 .