A. Missing quotes around bucket name; add quotes like "my-bucket"
B. Prefix should be a number, not a string
C. Backend type should be "google" instead of "gcs"
D. Bucket name cannot contain dashes
Solution
Step 1: Identify syntax error in bucket value
The bucket name must be a string, so it needs quotes around it.
Step 2: Correct the bucket value
Adding quotes fixes the syntax: bucket = "my-bucket".
Final Answer:
Missing quotes around bucket name; add quotes like "my-bucket" -> Option A
Quick Check:
Strings need quotes in Terraform config [OK]
Hint: Always quote string values in backend config [OK]
Common Mistakes:
Leaving string values unquoted
Confusing backend type names
Thinking bucket names cannot have dashes
5. You want to share Terraform state safely among your team using GCS backend. Which combination of settings ensures state locking and avoids conflicts?
hard
A. Use bucket with versioning enabled, set prefix, and enable project with IAM permissions
B. Use bucket without versioning, no prefix, and no project specified
C. Use local backend with manual file sharing
D. Use bucket with public access and no prefix
Solution
Step 1: Enable bucket versioning and set prefix
Versioning keeps history of state files; prefix organizes states per environment.
Step 2: Specify project and IAM permissions
Project and permissions ensure team members can access and lock the state to avoid conflicts.
Final Answer:
Use bucket with versioning enabled, set prefix, and enable project with IAM permissions -> Option A
Quick Check:
Versioning + prefix + permissions = safe shared state [OK]
Hint: Enable versioning and IAM for safe shared state [OK]
Common Mistakes:
Not enabling versioning on bucket
Omitting prefix causing state overwrites
Using public buckets risking security
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.