GCP ACE Practice / Study guide / Topics / Infrastructure as Code & Cloud Shell

Infrastructure as Code & Cloud Shell

What actually gets tested on the Google Cloud Associate Cloud Engineer exam, the traps to know, and 6 free sample questions with full explanations.

Cloud Shell is a free, browser-based shell with the Cloud SDK, kubectl, Terraform, and most common tools preinstalled — genuinely useful for interactive admin work without setting up a local environment. The exam-relevant detail is what persists and what doesn't: Cloud Shell provisions an ephemeral VM per session, but mounts a persistent 5 GB $HOME, so files, scripts, and configs saved there survive between sessions while anything installed outside $HOME does not. Sessions also end after roughly 20 minutes of inactivity and are subject to weekly usage limits, which makes Cloud Shell wrong for long-running jobs — those belong on a VM, Cloud Build, or another durable compute option.

Cloud Shell also includes a full graphical code editor over your persistent $HOME, plus a Web Preview feature that proxies a port from the Cloud Shell VM to your browser — useful for quickly checking a locally-running web app without deploying it anywhere first.

On infrastructure as code more broadly: the exam doesn't expect deep Terraform authorship, but it does expect you to recognize IaC as the right answer whenever a scenario is about repeatable, version-controlled infrastructure changes rather than manual console clicks — the same instinct that favors instance templates + managed instance groups over hand-created VMs, or Deployment Manager/Terraform over a one-off gcloud command typed once and never recorded anywhere.

Exam tips for this topic

Sample questions — Infrastructure as Code & Cloud Shell

These 6 questions are drawn from our full bank of 658 to show the style and depth you'll get in the app. Each comes with the full explanation you'd see after answering in a real practice session.

Cloud Shell

You need a machine with gcloud, kubectl, and terraform pre-installed to run a few admin commands, without installing anything locally. What is the fastest option?

Why: Cloud Shell is a free, browser-based shell with the Cloud SDK, kubectl, terraform, and many tools preinstalled, plus 5 GB of persistent home storage — ideal for quick admin work. A VM or local Docker adds setup time, and the mobile app is for monitoring and basic management, not full CLI work.
IaC

Your team wants all infrastructure declared in versioned code with plan/preview before changes. The de-facto standard tool on Google Cloud today is:

Why: Terraform is the dominant IaC on Google Cloud (Google's Infrastructure Manager runs it as a service); it previews plans and stores state. Deployment Manager is legacy/deprecated-adjacent for new projects, and script piles have no state or plan.
Cloud Shell

Which statement about Cloud Shell is true?

Why: Cloud Shell provisions an ephemeral VM per session, but mounts a persistent 5 GB $HOME so files, scripts, and configs survive. Software installed outside $HOME is lost when the session recycles, and no disk management is needed or possible.
IaC

A teammate reviewing your CI pipeline asks what its terraform plan and terraform apply steps do respectively. What is the answer?

Why: plan computes an execution diff (create/update/destroy) without touching anything; apply performs it (showing the plan again first by default). Nothing is destroyed unless the plan says so.
Cloud Shell

Which is a limitation of Cloud Shell you should plan around?

Why: Cloud Shell is for interactive admin work: sessions end after inactivity (about 20 minutes) and there are weekly usage limits, so long jobs belong on a VM, Cloud Run job, or build service. It is free, has the SDK preinstalled, and has outbound internet access.
IaC

You are pitching IaC to a team at your company that manages everything by console clicking. Why is IaC preferred for production? (Choose two.)

Why: IaC buys review, history, reproducibility, and drift detection — governance benefits. It has zero effect on runtime performance and complements (never replaces) IAM.

Practice this for real

The app has dozens more questions on this and every other topic, with instant scoring, spaced repetition of what you get wrong, and progress tracking across sessions.

Start practicing →

This topic shows up in

Domain 1Setting Up a Cloud Solution Environment Domain 3Deploying & Implementing a Cloud Solution

Other topics

TopicIAM Roles & Permissions TopicService Accounts & Identity TopicBilling, Pricing & Cost Management TopicGoogle Kubernetes Engine (GKE) Topicgcloud CLI Commands TopicChoosing the Right Compute Option TopicCompute Engine Deployment & Operations TopicCloud Monitoring, Logging & Audit Logs TopicVPC Networking & Load Balancing TopicChoosing a Database on Google Cloud TopicResource Hierarchy, Projects & APIs TopicCloud Storage: Classes, Access & Security TopicServerless Compute: Cloud Run & App Engine TopicData Protection: Encryption & Secret Manager