Chapter 11: Collaboration and Automation on GCP
Topic 72

Infrastructure Manager

ManagedComparison

Infrastructure Manager is Google's managed Terraform service. You hand it your HCL — from a Cloud Storage object or a connected Git repo — and Google hosts the state, runs the apply on Cloud Build under the hood, and ties the whole thing into GCP IAM. It is the GCP-native counterpart to HCP Terraform: the answer when you want managed Terraform runs without standing up your own state bucket, runners, and CI plumbing.

The pitch is that it removes the operational surface the previous topics built by hand. No hatch-tfstate bucket to provision and secure, no cloudbuild.yaml to maintain, no WIF trust to wire — Google owns the state and the runner. What you give up in exchange is control over the pipeline, and that tradeoff is the whole decision this topic helps you make.

The Deployment as the Unit

Infrastructure Manager wraps a config in a deployment resource. You point the deployment at your Terraform source, it runs plan and apply, and it tracks the result. The deployment — not a state file you manage — is the thing you interact with: you create it, update it when the source changes, and read its status. The object model is one level up from raw Terraform.

This matters because your mental model shifts from "a directory with state" to "a deployment Google operates." You no longer reach for the state file or the lock object; you operate the deployment through its API and IAM, and Google handles the Terraform mechanics underneath.

Google Hosts the State

There is no hatch-tfstate bucket to provision or secure for an Infra Manager deployment. Google stores and locks the state for you, which removes the entire backend-bootstrapping problem from Topic 69 — no bucket to create in a hatch-admin project, no bootstrap config on local state, no versioning lifecycle rule to tune. The chicken-and-egg of the bucket that cannot store its own state simply does not arise.

The flip side is that you operate through the deployment, not the raw state. You cannot edit an Infra Manager deployment's state as a GCS object the way you would a self-managed backend; it is Google's, and your interface is the deployment API. That is fine until you hit a situation that wants a hand terraform state mv, which the managed surface constrains.

Runs on Cloud Build Under the Hood

Infra Manager executes the Terraform on Cloud Build using a service account you specify. Its permissions and blast radius are governed by that SA exactly as in Topic 70 — it is managed Cloud Build, not a separate engine. The same rule applies: scope the deployment's service account to least privilege, because Infra Manager applies as that SA and its grants are the deployment's reach.

Reading it as "managed Cloud Build" keeps the security model familiar. Everything you learned about the build SA defining the blast radius carries over unchanged; Google has just taken over operating the runner and the state around it.

IAM-Native Access Control

Who can create, view, or apply a deployment is governed by GCP IAM roles — roles/config.admin to manage deployments, roles/config.agent for the service account that runs them. Deployment permissions live in the same IAM model as the rest of the org, rather than in a separate SaaS with its own user and team management. For a GCP-centric org this is the real draw: one identity model for infrastructure and for the tool that provisions it.

When to Choose It and the Tradeoff

Pick Infra Manager over self-hosted CI when you want Google to own state and runners and keep everything inside GCP IAM. Pick it over HCP Terraform when you want to avoid a separate vendor and stay GCP-native. Stay on self-hosted CI — Cloud Build or GitHub Actions plus WIF — when you need rich pull-request automation, multi-cloud runs, or policy-as-code that Infra Manager does not yet match. The choice is about how much of the pipeline you want to own.

The tradeoff is real on both sides. Infra Manager removes operational burden but gives less control over the run pipeline than a hand-built Cloud Build or GitHub Actions flow, and its feature surface trails HCP Terraform's — no built-in cost estimation, narrower policy tooling. It runs standard Terraform HCL, so there is nothing to rewrite; it is a runner and state host, not a new language, and assuming otherwise leads people to "port" configs that already run as-is.

Three ways to run managed Terraform
Infra Manager
Google runs Terraform, hosts state, access through GCP IAM; fully GCP-native, no extra vendor.
HCP Terraform
HashiCorp SaaS with the richest features and multi-cloud; pick for feature depth.
Self-hosted CI
Cloud Build or GitHub Actions plus WIF; maximum control over the pipeline.
Infra Manager vs HCP Terraform vs Self-Hosted CI

Infrastructure Manager — Google running Terraform for you, with GCP-hosted state and IAM-native access. Choose it to stay fully GCP-native with no extra vendor, accepting a feature surface that trails HCP Terraform.

HCP Terraform — HashiCorp's managed SaaS with the richest features: Sentinel policy, cost estimation, a private module registry, across multiple clouds. Choose it when you want that feature depth or run on more than GCP.

Self-hosted CI — Cloud Build or GitHub Actions plus WIF, giving maximum control over the pipeline and integrating with your existing CI. Choose it when you need custom PR automation, policy gates, or workflows the managed services do not offer.

Common Mistakes
  • Assuming Infrastructure Manager is a different IaC language and rewriting configs — it runs standard Terraform HCL; it is a runner and state host, not a new tool.
  • Giving the deployment's service account broad roles "to be safe" — Infra Manager applies as that SA, so its grants are the deployment's blast radius exactly as with raw Cloud Build.
  • Mixing Infra Manager and a self-managed GCS backend for the same stack — two systems now believe they own the state, and they will fight.
  • Reaching for Infra Manager when the team needs Sentinel policy or cost estimation — those live in HCP Terraform, and Infra Manager will leave that gap unfilled.
  • Treating Infra Manager state as something you can edit out-of-band like a GCS object — Google hosts it, and you operate through the deployment, not the raw state.
Best Practices
  • Choose Infrastructure Manager when you want managed Terraform that stays inside GCP IAM and avoids a separate vendor; reach for HCP Terraform when you need its richer policy and multi-cloud features.
  • Scope the deployment's service account to least privilege, since Infra Manager applies as that SA on Cloud Build.
  • Let Infra Manager own the state for its deployments and never point a self-managed backend at the same stack.
  • Govern who can apply deployments with GCP IAM roles — roles/config.admin versus a viewer role — rather than out-of-band access.
  • Keep the Terraform HCL standard and unchanged, since Infra Manager runs the same configuration the local CLI runs.
Comparable tools HCP Terraform the managed-SaaS counterpart with richer features Spacelift · Env0 managed Terraform platforms Cloud Build · GitHub Actions + WIF the self-hosted alternatives Atlantis PR-driven self-hosting

Knowledge Check

What does Infrastructure Manager host and run on your behalf?

  • It hosts and locks the state and runs your Terraform on Cloud Build under the hood, using a service account you specify
  • It hosts a brand-new proprietary IaC language that you write your deployments in, compiled down to raw GCP API calls at apply time
  • It runs your Terraform config on your own self-managed GKE cluster while Google watches over the apply
  • It hosts and locks the state for you but still requires you to run every terraform apply locally yourself

A team is asked to "port" their Terraform configs to Infrastructure Manager. What is the correction?

  • There is nothing to port — Infra Manager runs standard Terraform HCL; it is a runner and state host, not a new language
  • They must first rewrite every resource into Google's deployment-specific DSL before Infra Manager will accept and run it
  • They must convert all their HCL into YAML manifests, since Infra Manager only ever accepts YAML input
  • They must split every single resource into its own separate deployment file before importing them

When is self-hosted CI the better choice over Infrastructure Manager?

  • When the team needs rich PR automation, multi-cloud runs, or policy-as-code that Infra Manager does not yet match
  • Whenever the configuration grows to include more than ten managed resources in a single deployment
  • Only when the team flatly refuses to let any of its applies run on managed Cloud Build workers
  • Self-hosted CI is always the strictly better option in every case, since Infra Manager has no real use case in practice

How is an Infrastructure Manager deployment's blast radius governed?

  • By the service account it applies as on Cloud Build — its grants are exactly what the deployment can change
  • By a hard per-deployment cap on the number of resources that Google enforces centrally across the project
  • By the byte size of the uploaded Terraform source object sitting in the deployment's Cloud Storage bucket
  • It has no blast radius at all, because Google manually validates and approves every change before it applies

You got correct