Prepare and test your skills

Prepare and test your skills

Infrastructure as code tooling is the set of tools that define Google Cloud infrastructure and applications in versioned files instead of manual clicks. Infrastructure as Code (IaC) stores the desired end state in code, so the same files can create matching development, test, and production environments. Different tools cover different layers, from platform resources to Kubernetes applications.
The Terraform lifecycle through Infrastructure Manager (Infra Manager) is the ordered path from configuration code to running Google Cloud resources. Infrastructure Manager is the managed Google Cloud service that runs Terraform configurations, also called blueprints, without requiring a separate automation server. It provisions infrastructure resources only and does not deploy applications onto those resources.
Configuration data flows from a storage location to an automated build job and then to live resources. Logs flow from the build job to a managed storage bucket, and deployment metadata flows to storage for later queries. The workflow runs in fixed order:
terraform init to install providers and modules and terraform validate to check syntax.terraform apply to create resources, and runs terraform destroy when deleting a deployment.Only after the apply step succeeds do the Google Cloud resources exist as described by the configuration. The completed deployment can then be queried for its status, its list of deployed resources, and details about individual resources.
Terraform initialization, preview, and managed state control how changes are prepared, reviewed, and tracked. Initialization with terraform init prepares the working directory by installing providers and modules, while terraform validate checks syntax and preview shows what would change before anything is applied. A GitOps flow can run terraform plan on feature branches without applying anything, then apply only after code is merged to development or production branches.
Infrastructure Manager stores Terraform state automatically as the central source of truth for each deployment. For each deployment and each revision, Infrastructure Manager stores related records together:
Because Infrastructure Manager handles state, configurations that use it follow specific constraints. Backend blocks should not be defined, templating or generation of Terraform is not supported, and provisioners are not recommended because the runtime environment can change at any time. Configuration values must not include personal or sensitive information, and the configuration must work with a supported Terraform version.
Exam tip: Do not define a backend block when deploying with Infrastructure Manager, because Infrastructure Manager stores the state file for each deployment and revision itself.
Fabric FAST blueprints are standardized Terraform packages for building landing zones and foundations the same way every time. A Terraform module is a reusable set of configuration files that creates a logical abstraction for one area, such as networking, storage, or identity. A blueprint is a larger package of deployable, reusable modules plus policy and documentation that implements an opinionated solution.
Modules and blueprints differ in scope and reuse, so teams choose the package that matches the size of the problem:
| Option | What it contains | Use it when |
|---|---|---|
| Module | Reusable configuration files for a logical group of resources | A single capability needs to be reused consistently across environments |
| Blueprint | Deployable modules plus policy and documentation for an opinionated solution | A full landing zone or foundation needs to be deployed the same way every time |
The catalog shows this pattern in practice. The fabric collection provides advanced examples designed for prototyping, while the example-foundation blueprint shows how Cloud Foundations Toolkit modules can be composed into a secure cloud foundation. The bootstrap module helps start Terraform usage and related CI/CD in a new Google Cloud organization, so new environments begin from versioned, reviewed, and auditable code.
Config Connector is a Kubernetes extension that manages Google Cloud resources through Kubernetes configuration files. Config Connector provides Kubernetes Custom Resource Definitions (CRDs) where each CRD configures one type of Google Cloud resource from Kubernetes using declarative YAML. The YAML can be versioned, reused, and stored in source control, so teams can use standard Kubernetes tools and CI/CD pipelines for both workloads and infrastructure.

A sequence diagram showing the Config Connector reconciliation loop: you apply YAML with a spec to the Kubernetes object, Config Connector actuates the change to create or update the Cloud SQL resource in Google Cloud, then observes the live resource, updates status, and corrects drift until status.condition reports True.
Each Config Connector resource is a Kubernetes object that creates and manages a matching Google Cloud resource. For example, a Kubernetes object of kind: SQLInstance creates a Cloud SQL instance in Google Cloud. The Kubernetes object remains the single source of truth for the desired configuration of the cloud resource. If someone changes the cloud resource outside Kubernetes, Config Connector detects the difference and corrects it.
Each Config Connector resource separates user intent from system feedback with distinct spec and status fields. The separation keeps reported state from being overwritten by user edits and lets users check readiness and errors in one place.
| Field | Purpose | Who writes it |
|---|---|---|
spec | Defines the desired state of the Google Cloud resource, such as databaseVersion | You declare it in YAML |
status | Reports the current state, readiness, and error messages, such as connectionName | Config Connector updates it after reading Google Cloud |
The continuous reconciliation loop keeps the live Google Cloud resource aligned with the declared object. Data flows from the applied YAML to Config Connector and then to Google Cloud, while observations flow back from Google Cloud into status. The loop runs in order:
spec and metadata to the cluster.spec.status, and corrects drift so the live value becomes eventually consistent with spec.This loop provides consistency without manual checks because later observations drive the resource back toward the declared state. A reconciled and ready resource reports its ready condition as True in status.condition.
Object metadata in Config Connector controls how each Kubernetes object maps to its Google Cloud resource. Metadata connects Kubernetes organization concepts to Google Cloud organization concepts, so existing Kubernetes practices for organizing, selecting, and auditing objects apply directly to cloud resources.
spec.resourceID, you can specify a different Google Cloud name that follows Google Cloud naming rules.managed-by-cnrm with a value of true.spec, such as lifecycle controls. Annotation values must be strings.Name and resourceID preserve the boundary between Kubernetes naming rules and Google Cloud naming rules. Namespace maps the Kubernetes boundary to the Google Cloud project boundary, and labels propagate from Kubernetes to Google Cloud for selection and cost tracking. Access is controlled by Kubernetes Role Based Access Control (RBAC), where permission to create a Config Connector object grants the ability to create the corresponding cloud resource. Config Connector also supports resources in Google Cloud folders and organizations, so one Kubernetes-native workflow can manage both workload resources and their hierarchical containers.
Helm packaging is the use of IaC to package, version, and deploy Kubernetes applications in a repeatable way. A Helm chart is a versioned package that bundles all Kubernetes resources needed for an application into one reusable unit. The chart declares the desired state of the application, so Helm and Kubernetes work to make the live environment match that declared state.
Templates and values files separate reusable structure from per-environment settings. Templates define the common Kubernetes manifests with placeholders for image names, replica counts, resource limits, and connection settings. Data flows from the values file into the templates, and Helm renders the templates into final manifests that are applied to the cluster. A team keeps one shared chart and maintains a different values file for development, test, and production, so only the values change while the chart structure stays consistent. Charts and values files live in source control and move through CI/CD pipelines with review and validation, which reduces manual effort and supports audit and revert.
Helm fills the application layer, while Terraform-based tools provision the underlying platform including Google Kubernetes Engine (GKE) (opens in a new tab) clusters. The tools depend on different inputs and produce different outputs:
| Tool | What it manages | Choose when |
|---|---|---|
| HashiCorp Terraform | Google Cloud infrastructure including VMs, networks, storage, and GKE clusters | The need is to provision and manage platform resources with versioned, reusable configuration |
| Infrastructure Manager | Deployment of Terraform configurations on Google Cloud | The need is to deploy Terraform programmatically using a Google Cloud service |
| Helm | Kubernetes applications packaged as charts with templates and values files | The need is to package, version, and deploy workloads inside a Kubernetes cluster across environments |
Use Terraform to create the cluster and Helm to deploy applications onto it, so platform provisioning and application orchestration stay in separate, reusable layers. This separation lets infrastructure teams and application teams work from their own versioned packages while sharing the same review and pipeline practices.
Planning and executing IaC deployments is the discipline of storing infrastructure logic as code and applying it through automated, repeatable workflows. Versioning provides history and review, state management tracks what was deployed, and updates move live resources to a new desired state. Together they improve consistency and reduce human error across environments.
Versioned configurations and immutable redeploys keep infrastructure changes safe and predictable over time. Versioning means storing infrastructure provisioning and configuration logic in source control where every change can be tracked, reviewed, and audited. Because the configuration lives in a repository, a CI/CD pipeline can automatically test and deploy every change before it reaches production.
Immutable infrastructure is the rule that a virtual machine, Kubernetes cluster, or firewall rule is never tweaked after deployment. The update is made to the configuration in the source repository instead, which avoids configuration drift and snowflake servers that become unique and hard to reproduce. The update follows a fixed order from source code to live environment:
This sequence makes deployments and rollbacks more predictable because every environment is re-created from the same versioned source. Data flows from the repository through testing and deployment to the live Google Cloud environment.
A deployment update in Infrastructure Manager (opens in a new tab) is a new revision of an existing deployment that either corrects drift or implements intended change. Drift happens when live resources change outside Terraform, such as when someone edits a resource in the console. Intended change happens when the desired infrastructure itself needs to be different.
The configuration used for the update depends on the goal:
| Goal | Configuration used for the update | Example |
|---|---|---|
| Return infrastructure to a chosen state | The original Terraform configuration is applied again | Reapply the deployed configuration after a manual console change |
| Implement changes to infrastructure | A new or edited Terraform configuration is applied | Add a new virtual machine or change a bucket setting |
Choose the first option when the configuration is still correct but the live environment has drifted. Choose the second option when the desired infrastructure has changed and the configuration must describe the new state.
Prerequisites before executing an update ensure that Infrastructure Manager has the identity, permissions, configuration, and capacity needed to apply changes safely. The update depends on both the calling identity and the service account that acts on Google Cloud resources. Missing permissions, quota, or continuity planning causes deployment errors or service interruption.
roles/config.admin to manage deployments.If the revision defines different resources than the original deployment, the service account needs permissions for resources defined in both configurations. Previewing the update lets teams review proposed changes before they are applied.
The Infrastructure Manager execution workflow applies configuration changes through an automated Cloud Build job that moves from source code to live resources in a fixed order. Data flows from the Cloud Storage bucket or Git repository that holds the Terraform module to the Cloud Build job, and then from the Cloud Build job to the target Google Cloud resources. Logs flow from the Cloud Build job to a Cloud Storage bucket created by Infrastructure Manager, and deployment metadata flows from the job to Cloud Storage for later queries.
terraform init to prepare the working directory and providers.terraform validate to check that the configuration is syntactically correct.terraform apply to provision or modify resources, or terraform destroy when the deployment is being deleted.terraform init or terraform apply fails from causes such as intermittent network outages, Infrastructure Manager automatically retries those operations a limited number of times.Only after the apply step succeeds are the Google Cloud resources provisioned as described by the configuration. When the deployment is complete, you can query Infrastructure Manager for the status of the deployment, the list of resources deployed as part of the deployment, and details about individual resources in the deployment.
The runtime environment for Infrastructure Manager is an ephemeral Cloud Build environment that exists only for the duration of the Terraform run. You select which supported version of Terraform to use for each deployment, while the operating system and installed software inside the environment are managed by Google Cloud and can change at any time. The environment is discarded after the run, so no state or software persists between runs, while deployment metadata is retained in Cloud Storage.
State management and consistency keep deployed cloud resources matched to versioned configuration so every environment is reproducible. Google Cloud resources managed this way live inside projects, which contain service resources such as Compute Engine virtual machines, Pub/Sub topics, Cloud Storage buckets, and Cloud VPN endpoints. Automation creates those resources from the same tested configuration rather than by separate manual steps, so development, testing, and production environments stay aligned. Tools that support this model include Infrastructure Manager for automated creation and management, Config Connector for Kubernetes-native workflows, Terraform for defining and deploying infrastructure, and Chef and Puppet for configuration management. Do not include personal or sensitive information in Terraform configuration values, because configuration values are handled as part of this automated workflow and stored with deployment data.
Exam tip: Immutable infrastructure means never modify a deployed resource — update the configuration in source control and fully redeploy the resource.
terraform init, preview or apply with terraform apply, and stores logs, configuration, resource lists, and state per deployment revision.spec for desired state written by the user and status for observed state reported by the controller, with Kubernetes namespace mapping to the Google Cloud project.A Terraform module is a reusable set of configuration files that creates a logical abstraction for one area such as networking, storage, or identity and is used when a single capability needs to be reused consistently across environments. A Fabric FAST blueprint is a larger package of deployable, reusable modules plus policy and documentation that implements an opinionated solution and is used when a full landing zone or foundation needs to be deployed the same way every time.
You should not define a backend block because Infrastructure Manager (Infra Manager) stores Terraform state automatically as the central source of truth for each deployment and each revision. For each deployment and revision it stores the logs from the Cloud Build job, the configuration used, the list of Google Cloud resources created, and the state file together.
Config Connector uses the spec field declared by you in YAML to define the desired state and updates the status field itself to report current state, readiness, and errors. It runs a continuous reconciliation loop where you apply YAML, Config Connector creates or updates the Google Cloud resource toward spec, then periodically reads the resource, updates status, and corrects drift so the live value becomes eventually consistent with spec.
Use HashiCorp Terraform to provision and manage platform resources including virtual machines, networks, storage, and Google Kubernetes Engine (GKE) clusters with versioned reusable configuration. Use Infrastructure Manager (Infra Manager) when you need to deploy Terraform configurations programmatically using a Google Cloud service, and use Helm when you need to package, version, and deploy Kubernetes applications as charts with templates and values files inside a cluster. In practice use Terraform to create the cluster and Helm to deploy applications onto it so platform provisioning and application orchestration stay in separate reusable layers.
Last updated