Professional Cloud DevOps Engineer · Domain 1: Establishing and bootstrapping foundational infrastructure and organizational governance · 18% of the exam
Task 1.2: Managing infrastructure.
Infrastructure as code with Terraform, Infrastructure Manager, Config Connector, Application Design Center, GitOps and Helm; changes through Google's modules and blueprints; scripted automation; and Provisioned Throughput for reliable agents.
Study it
Infrastructure as code: Terraform, Infrastructure Manager, Config Connector and Application Design Center
Lesson coming
Provisioned Throughput for agent reliability
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the Google Cloud documentation page that proves it.
Question 1 · choose 1
A platform team has spent a year hardening its own Terraform modules for a private GKE cluster and a Cloud SQL instance with the company's network and encryption settings. It is adopting Application Design Center so that developers can design and deploy applications from approved building blocks, and it wants those hardened modules to be among the blocks. What should the team do?
AImport the modules into Application Design Center as components and use them in the team's templates
BBuild each Application Design Center design from Google components only, and apply the hardened settings afterwards with gcloud
CPublish the modules in a Git repository and ask developers to call them from their own root modules
DConvert the modules into Config Connector manifests and sync them to the developers' clusters
Show the answer and why
AImport the modules into Application Design Center as components and use them in the team's templates
Correct
Application Design Center accepts imported components based on an organization's own Terraform modules, next to the Google components.
BBuild each Application Design Center design from Google components only, and apply the hardened settings afterwards with gcloud
Incorrect
Google components are one source of building blocks, not the only one, and fixing settings by hand after deployment loses the governance the templates are meant to carry.
CPublish the modules in a Git repository and ask developers to call them from their own root modules
Incorrect
That reuses the modules outside Application Design Center, so they never become building blocks in its designs, templates or catalog.
DConvert the modules into Config Connector manifests and sync them to the developers' clusters
Incorrect
Config Connector manages Google Cloud resources as Kubernetes objects; it does not add building blocks to Application Design Center.
In Application Design Center, components are the building blocks of application templates: Google components follow Google Cloud best practices, and imported components are built from an organization's own Terraform modules. Platform teams combine them into templates and share them through a catalog, so developers deploy designs that already carry the hardened settings.
A customer-support agent running on Cloud Run calls a Gemini model on Gemini Enterprise Agent Platform with pay-as-you-go requests. Its traffic is high all day, every day, and during the busiest hours some model calls are throttled, so customers see slow or failed answers. The business wants the agent's model capacity to be reserved so its users get a consistent experience. What should the DevOps team set up?
ARaise the maximum number of Cloud Run instances so the agent can send more model calls in parallel
BA Provisioned Throughput order for the model in the region where the agent sends its requests
CExplicit context caching of the agent's long system instructions and product catalog
DThe X-Vertex-AI-LLM-Request-Type header set to shared on every request the agent sends
Show the answer and why
ARaise the maximum number of Cloud Run instances so the agent can send more model calls in parallel
Incorrect
Maximum instances limits how far the agent service itself scales; more instances send more requests but do not reserve any model throughput.
BA Provisioned Throughput order for the model in the region where the agent sends its requests
Correct
Provisioned Throughput is a fixed-term subscription that reserves throughput for a model in a location, recommended for real-time agents that need consistently high throughput and a predictable experience.
CExplicit context caching of the agent's long system instructions and product catalog
Incorrect
Caching repeated content reduces the cost and latency of those tokens; it does not reserve model capacity for the agent.
DThe X-Vertex-AI-LLM-Request-Type header set to shared on every request the agent sends
Incorrect
The header only chooses the consumption mode of each request; it reserves no capacity, so the agent's calls are still throttled at peaks.
For production agents whose critical traffic consistently needs high throughput, Provisioned Throughput reserves capacity for a chosen model and location at a fixed price, giving users a consistent experience. Requests in that region consume the order automatically once it is active.
A BigQuery dataset holding three years of reporting data is managed by Config Connector from a manifest in a GKE cluster. The team is moving the dataset to its Terraform configuration and must remove the Config Connector object from the cluster while the dataset and its tables stay in BigQuery. What should the team do before it runs kubectl delete on the object?
ARemove the resourceID field from the manifest and apply it, so that the object no longer points at the existing dataset
BRun the delete with --cascade=orphan, so that Kubernetes leaves the dependents of the object in place
CAdd the annotation cnrm.cloud.google.com/deletion-policy: abandon to the object's metadata and apply the manifest
DExport the tables to Cloud Storage, delete the object, and re-create the dataset from the Terraform configuration
Show the answer and why
ARemove the resourceID field from the manifest and apply it, so that the object no longer points at the existing dataset
Incorrect
resourceID decides which existing resource Config Connector acquires; it does not change what happens on deletion, which by default deletes the Google Cloud resource.
BRun the delete with --cascade=orphan, so that Kubernetes leaves the dependents of the object in place
Incorrect
Cascade options govern dependent Kubernetes objects; Config Connector still deletes the dataset unless the object carries the abandon deletion policy.
CAdd the annotation cnrm.cloud.google.com/deletion-policy: abandon to the object's metadata and apply the manifest
Correct
With the abandon deletion policy, deleting the Config Connector resource leaves the Google Cloud resource in place.
DExport the tables to Cloud Storage, delete the object, and re-create the dataset from the Terraform configuration
Incorrect
Deleting the object deletes the dataset, so the team would have to reload every table; the deletion policy avoids that outage and work.
By default, deleting a Config Connector object deletes the Google Cloud resource it manages. To keep the resource, add the cnrm.cloud.google.com/deletion-policy: abandon annotation before deleting the object; another tool can then take the resource over.
A service's Terraform code is one root configuration that uses CLI workspaces named dev, qa and prod with a single shared backend. Reviewers struggle with expressions such as terraform.workspace == "prod" ? 3 : 1, and an outage of the shared backend would block all three environments. Which layout do Google's Terraform best practices recommend?
AA modules directory holding the service module, plus environment directories that each have their own backend.tf and main.tf
BThe same workspaces, with each workspace's state moved to its own prefix in the shared backend bucket
COne long-lived branch per environment in the repository, each branch holding a copy of the service's root directory
DOne root configuration with a .tfvars file per environment, passed with -var-file to plans that use one state
Show the answer and why
AA modules directory holding the service module, plus environment directories that each have their own backend.tf and main.tf
Correct
Each environment directory is a root configuration with its own backend that instantiates the shared service module, using only the default workspace.
BThe same workspaces, with each workspace's state moved to its own prefix in the shared backend bucket
Incorrect
Multiple CLI workspaces within an environment are not recommended, and the workspace conditionals that confuse reviewers remain.
COne long-lived branch per environment in the repository, each branch holding a copy of the service's root directory
Incorrect
The recommended way to share code across environments is to reference a module from environment directories, not to keep diverging copies on branches.
DOne root configuration with a .tfvars file per environment, passed with -var-file to plans that use one state
Incorrect
A single state for all environments means each apply would replace the previous environment's resources; environments need isolated state.
Google recommends splitting a service's Terraform into a modules directory with the actual configuration and an environments directory with one root configuration per environment. Each environment directory declares its own backend in backend.tf and uses only the default workspace, which avoids hard-to-read workspace conditionals and a shared backend as a single point of failure.
One Terraform root configuration manages about 600 resources for a whole platform: shared networking, several applications and their databases. Every plan now takes over 20 minutes, even for a one-line change to a single application. What do Google's Terraform best practices recommend?
ARaise the -parallelism value on every plan and apply, so that Terraform refreshes more resources at the same time
BMove the state from the local disk to a Cloud Storage backend, so that state reads and writes go faster
CGroup the application and shared resources into child modules called from the same root configuration
DSplit it into separate root configurations per application and shared service, each with its own state
Show the answer and why
ARaise the -parallelism value on every plan and apply, so that Terraform refreshes more resources at the same time
Incorrect
Every resource in a root configuration is still refreshed on every run; more parallel calls do not shrink the state that causes the slow runs.
BMove the state from the local disk to a Cloud Storage backend, so that state reads and writes go faster
Incorrect
A remote backend helps sharing and locking, but the number of resources refreshed on each run stays the same.
CGroup the application and shared resources into child modules called from the same root configuration
Incorrect
Child modules called from one root still share that root's single state, so every run refreshes all 600 resources.
DSplit it into separate root configurations per application and shared service, each with its own state
Correct
All resources in a root configuration are refreshed on every run, so the guidance is to keep each state small, with no more than 100 resources and ideally a few dozen.
Terraform refreshes every resource in a root configuration's state each time it runs, so large states make every plan slow. Google's guidance is to put each application and shared service in its own directory and root configuration, keeping each state to a few dozen resources and under 100.
A module creates a logging sink only when a project ID is passed in. The
root configuration creates the project in the same apply and passes
google_project.app.project_id to the module. The module contains:
resource "google_logging_project_sink" "audit" {
count = var.project_id == "" ? 0 : 1
project = var.project_id
...
}
terraform plan fails with "value of count cannot be computed". What fix do
Google's Terraform best practices suggest?
ARun the plan with -refresh=false, so that Terraform skips reading the project before it evaluates count
BAdd a separate boolean variable, such as enable_sink, and compute count from that variable instead
CGive var.project_id a default value of an empty string, so that count always has a value to compare with
DMove the comparison into a local value built from var.project_id and use that local value in count
Show the answer and why
ARun the plan with -refresh=false, so that Terraform skips reading the project before it evaluates count
Incorrect
The project does not exist yet, so its ID is unknown at plan time whether or not Terraform refreshes existing resources.
BAdd a separate boolean variable, such as enable_sink, and compute count from that variable instead
Correct
When count depends on an attribute of a resource that does not yet exist, Terraform cannot plan; a separate enable variable makes the condition known at plan time.
CGive var.project_id a default value of an empty string, so that count always has a value to compare with
Incorrect
A default only applies when no value is passed; the root still passes an attribute that is unknown until the project is created.
DMove the comparison into a local value built from var.project_id and use that local value in count
Incorrect
The local value is derived from the same unknown attribute, so count is still not computable at plan time.
Use the count meta-argument for conditional resources, but be sparing with user-specified variables in count: if the variable carries an attribute of a resource that does not exist yet, such as a new project's ID, Terraform reports that the value of count cannot be computed. A separate enable_x variable keeps the condition known at plan time.