Question 1

An application records business error codes in text logs that are not available as native metrics. Which observability technique can count them?

  1. Use Logs Explorer
  2. Use a Logs Router sink
  3. Use Cloud Trace
  4. Enable log-based metrics
  5. Use an organization log sink

Explanation

Correct Answer

D:

Log-based metrics derive metric values from matching log entries and can support dashboards or alerts; the decisive property here is converting matching log entries into metric time series.

Incorrect Answers

A:

Logs Explorer supports interactive filtering, viewing and investigating entries in authorized log buckets; it would help with filtering operational log records interactively, but it does not directly implement converting matching log entries into metric time series.

B:

Log sinks use inclusion filters and destination permissions to route supported log entries from a configured scope; it is appropriate for exporting filtered log streams to a destination; here, the deciding requirement is converting matching log entries into metric time series.

C:

Cloud Trace collects and visualizes distributed request traces and span timings; it is not the focused action for converting matching log entries into metric time series; its primary use is analyzing latency along a request trace.

E:

Aggregated sinks at suitable resource ancestors can route descendant logs subject to sink configuration and permissions; this governs aggregating organization-wide log exports, whereas the stated objective is converting matching log entries into metric time series.

Question 2

An HTTP service needs different Google Cloud access from the team that deploys it. Which runtime identity setting achieves separation?

  1. Use a Cloud Run service account
  2. Choose Cloud Run services
  3. Use Cloud Run concurrency setting
  4. Choose Cloud Run functions

Explanation

Correct Answer

A:

The scenario depends on separating runtime permissions from deployer access; Cloud Run services can run as a configured service account with IAM-granted permissions.

Incorrect Answers

B:

Cloud Run hosts container services with managed request routing and configurable instance scaling; Applying it would target serving HTTP traffic on managed serverless containers, leaving the separate need for separating runtime permissions from deployer access.

C:

Cloud Run concurrency controls how many concurrent requests a service instance may receive; this is a distinct control for limiting simultaneous request handling at an instance, rather than separating runtime permissions from deployer access.

D:

Cloud Run functions supports managed function deployments with event integration and request-based execution; it concerns processing events with managed functions, and its normal effect does not provide separating runtime permissions from deployer access.

Question 3

A data transformation container needs retries and task parallelism rather than a request-serving endpoint. Which Cloud Run construct fits?

  1. Choose Cloud Run functions
  2. Choose Cloud Run services
  3. Choose GKE Standard
  4. Use Cloud Run jobs

Explanation

Correct Answer

D:

What matters is running task-oriented serverless containers; Cloud Run jobs run tasks to completion without exposing a request-serving service endpoint.

Incorrect Answers

A:

Cloud Run functions supports managed function deployments with event integration and request-based execution; the scenario specifies running task-oriented serverless containers, which differs from executing short event-oriented application code.

B:

Cloud Run hosts container services with managed request routing and configurable instance scaling; it concerns serving HTTP traffic on managed serverless containers, and its normal effect does not provide running task-oriented serverless containers.

C:

GKE Standard runs Kubernetes with user-managed node pools and more infrastructure configuration control; that supports administering GKE infrastructure settings directly; the problem to solve concerns running task-oriented serverless containers.

Question 4

A script must address an explicit project even when an operator has an unrelated active configuration. What command practice prevents drift?

  1. Enable a service API for the project
  2. List enabled project services
  3. Authenticate with gcloud auth login
  4. Pass a per-command --project flag

Explanation

Correct Answer

D:

The requirement is pinning project context at invocation time; A --project argument overrides the configured project for supported gcloud commands for that invocation.

Incorrect Answers

A:

The alternative would address allowing that service's API in the project; Service Usage controls API enablement for each project; authorization and billing are separate requirements; the question instead requires pinning project context at invocation time.

B:

The Service Usage listing and its gcloud services list interface expose enabled and available service states; Applying it would target inspecting a project's enabled API inventory, leaving the separate need for pinning project context at invocation time.

C:

Gcloud auth login authorizes a user account for gcloud, subject to its IAM permissions; Applying it would target establishing user credentials for the Cloud SDK, leaving the separate need for pinning project context at invocation time.

Question 5

A Cloud Run service needs permission to publish messages independently of the engineer who deploys it. Which runtime setting should be chosen?

  1. Grant service account user role for attachment
  2. Attach a service account to Cloud Run
  3. Grant target resource role to service account
  4. Avoid exporting service account keys
  5. Create a dedicated service account

Explanation

Correct Answer

B:

Cloud Run services use configured runtime service accounts for Google Cloud API calls; it is the direct control for setting the identity of a serverless service.

Incorrect Answers

A:

Service Account User includes the iam.serviceAccounts.actAs permission used for attaching a service account to supported resources; it would help with authorizing workload identity attachment, but it does not directly implement setting the identity of a serverless service.

C:

This alternative focuses on authorizing the account on the target resource; Attaching an account establishes identity but the service account still needs IAM permissions on the resources it accesses; the stem instead asks for setting the identity of a serverless service.

D:

Managed service-account credentials are generally safer than downloadable private keys because the platform supplies short-lived tokens; this governs using workload-attached credentials instead of embedded secrets, whereas the stated objective is setting the identity of a serverless service.

E:

Dedicated service accounts provide separate nonhuman identities for workloads and make IAM grants auditable; it would help with isolating workload authorization from user credentials, but it does not directly implement setting the identity of a serverless service.

Question 6

An organization integrates workload federation but needs to reject tokens from unrelated projects at the same issuer. Which control helps?

  1. Bind GKE workload identity to IAM
  2. Use signed identity tokens for authenticated endpoints
  3. Restrict federation provider attributes
  4. Enable GKE metadata server

Explanation

Correct Answer

C:

Workload identity provider attribute conditions restrict accepted external identity assertions; Applied in this case, it delivers enforcing attribute-based identity federation conditions.

Incorrect Answers

A:

Workload Identity Federation for GKE establishes workload identities that receive supported IAM access without embedded private keys; the decision here is about enforcing attribute-based identity federation conditions, not connecting GKE workload identity to cloud IAM permissions.

B:

Authenticated Cloud Run HTTP invocation uses supported OIDC identity tokens with an appropriate audience and invoker permission; this is a distinct control for authenticating service-to-service HTTP invocations, rather than enforcing attribute-based identity federation conditions.

D:

The GKE metadata server handles token access and identity federation for configured workloads on eligible GKE nodes; that applies to supplying metadata-server identity tokens to Pods; the requested task is enforcing attribute-based identity federation conditions.

Question 7

A research project has moved to another division and must receive the new division's inherited policies. What is the appropriate hierarchy change?

  1. Create a project under an organization folder
  2. Apply an organization policy constraint
  3. Move the project to a different folder
  4. Use the organization resource

Explanation

Correct Answer

C:

Moving a project between eligible folders changes its ancestor path and inherited organization and IAM policies; this is the specific mechanism used for changing the project's ancestor and inherited controls.

Incorrect Answers

A:

A Google Cloud project is the primary boundary for enabled services, resources, IAM and many quotas; that mechanism handles isolating a workload in its own project; it does not configure changing the project's ancestor and inherited controls.

B:

Organization Policy Service evaluates supported constraints along the resource hierarchy independently of ordinary IAM grants; the decision here is about changing the project's ancestor and inherited controls, not preventing disallowed resource settings through policy.

D:

The organization node is the top governance resource associated with the company's identity domain; it is relevant when enforcing controls across the full resource hierarchy, not when the primary need is changing the project's ancestor and inherited controls.

Question 8

A support group needs the same viewer role for all child projects in one branch and none elsewhere. Where should it be granted?

  1. Use IAM Conditions
  2. Bind IAM role at folder scope
  3. Remove an IAM policy binding
  4. Grant a predefined IAM role

Explanation

Correct Answer

B:

Folder IAM policies can grant inherited permissions to descendant projects and resources; for the stated workload, the practical result is inheriting permissions through one folder subtree.

Incorrect Answers

A:

IAM Conditions attach supported CEL expressions to role bindings to restrict when permissions apply; it is relevant when restricting IAM bindings with expressions, not when the primary need is inheriting permissions through one folder subtree.

C:

For revoking a principal's existing project role, this could be relevant; Removing an IAM binding eliminates that grant path, although other inherited or indirect grants may remain; the actual request concerns inheriting permissions through one folder subtree.

D:

Predefined roles contain Google-managed permission sets tailored to particular products and tasks; it is relevant when assigning built-in least-privilege service permissions, not when the primary need is inheriting permissions through one folder subtree.

Question 9

An application VM must not initiate outbound connections to untrusted CIDR ranges. Which firewall direction and action applies?

  1. Use VPC firewall egress deny
  2. Use VPC firewall ingress allow
  3. Use firewall priority evaluation
  4. Use firewall target service accounts

Explanation

Correct Answer

A:

Egress deny rules block matching traffic initiated by selected resources to the configured destinations; this is the capability needed for blocking outbound connections to a destination range.

Incorrect Answers

B:

Ingress allow rules permit matching incoming connections to specified targets subject to higher-priority policies; that mechanism handles opening a targeted inbound network flow; it does not configure blocking outbound connections to a destination range.

C:

Firewall policy priority and evaluation hierarchy determine which matching action takes effect; it is not the focused action for blocking outbound connections to a destination range; its primary use is resolving precedence between overlapping firewall rules.

D:

VPC firewall rules can use supported service-account selectors to identify target VM interfaces; that applies to applying network rules to VM service account targets; the requested task is blocking outbound connections to a destination range.

Question 10

Two automation runs might update the same infrastructure state concurrently. Which mechanism should prevent simultaneous writers when supported?

  1. Run terraform apply
  2. Use Terraform state locking
  3. Use a declarative desired-state configuration
  4. Use Terraform modules

Explanation

Correct Answer

B:

Terraform backends with locking semantics protect supported state operations from concurrent modification; it supports serializing infrastructure state changes at the appropriate resource scope.

Incorrect Answers

A:

Terraform apply performs authorized resource changes described by the configuration or saved plan; it is relevant when executing declared infrastructure updates, not when the primary need is serializing infrastructure state changes.

C:

Declarative infrastructure configuration specifies intended resources while tooling computes the necessary changes; it is relevant when describing target infrastructure state rather than click sequences, not when the primary need is serializing infrastructure state changes.

D:

Terraform modules encapsulate resource definitions and input/output interfaces for reuse; its operational role is standardizing infrastructure through reusable components; the needed capability is serializing infrastructure state changes.

Associate Cloud Engineer Practice Tests