Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
Your platform engineering team is adopting Terraform to provision and manage Google Cloud foundation resources across multiple project environments. Currently, individual team members run Terraform locally, which causes state synchronization conflicts and increases the risk of corrupted resource mappings.
You need to establish a collaborative Terraform lifecycle workflow that centralizes state storage, prevents concurrent modification issues, and retains a history of deployments according to Google Cloud best practices.
Which configuration should you implement?
backend.tf pointing to a Cloud Storage bucket with Object Versioning enabledA remote state backend in Terraform shifts the location where Terraform stores its state database from the local workstation filesystem to a centralized, shared object store—specifically Cloud Storage (GCS) in Google Cloud. Configuring the gcs backend within backend.tf allows multiple team members and CI/CD automation pipelines to reference a single authoritative source of truth for the managed cloud environment.
gs://PROJECT_ID-tfstate) eliminates discrepancies between local machines, ensuring all team members operate against identical real-world resource mappings.terraform plan or terraform apply, Terraform locks the state file to prevent other executions from creating conflicting modifications or corrupting state..tfstate files across developer workstations.Using Cloud Storage as a remote backend is Google Cloud's standard operational recommendation for collaborative Terraform workflows. It provides enterprise-grade durability, seamless security integration with IAM permissions, and automated concurrency protection without introducing complex third-party infrastructure.
terraform.tfstate file to a shared Git repository on every execution to synchronize state changesStoring local terraform.tfstate files inside a Git version control repository involves committing and pushing the state file alongside application code and configuration files after every local execution.
terraform apply concurrently, both will attempt to modify and push conflicting state files, inevitably leading to merge conflicts and severe state file corruption.The requirement were to track declarative .tf configuration code, module definitions, and environment manifests within version control rather than the dynamic runtime state database.
Best practices strictly dictate adding *.tfstate and *.tfstate.backup to .gitignore files to ensure state files are never committed to version control.
terraform plan execution to maintain state historySecret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other confidential data. It manages secret payloads with fine-grained IAM controls and provides automated secret versioning.
terraform init, plan, or apply lifecycle stages.terraform plan does not capture the actual provisioned infrastructure, as state updates only occur during the execution phase (terraform apply).terraform { backend "..." {} } configuration block.You needed to securely store and retrieve sensitive input variables, API keys, or database credentials that Terraform configurations reference during execution.
terraform initThis approach relies on a network file system (NFS) share or network drive mounted across local developer machines to hold a single terraform.tfstate file while skipping Terraform backend initialization.
terraform init causes Terraform to fail immediately because initialization is required to load provider plugins, validate backend configuration, and prepare the working directory.terraform init) needed to initialize backend drivers and providers.You were running single-node legacy automation on-premises where object storage was entirely unavailable and local disk paths were mandatory.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated