Question 20

An organization must send selected logs to a Cloud Storage bucket for retention outside the source project. Which logging mechanism fits?

  1. Use Cloud Monitoring workspace scope
  2. Use Logs Explorer
  3. Use a Logs Router sink
  4. Use Cloud Logging setup

Explanation

Correct Answer

C:

Log sinks use inclusion filters and destination permissions to route supported log entries from a configured scope; this is the specific mechanism used for exporting filtered log streams to a destination.

Incorrect Answers

A:

Cloud Monitoring metrics scopes can make data from multiple monitored projects accessible in one scoping project; it concerns establishing multi-project metric visibility, and its normal effect does not provide exporting filtered log streams to a destination.

B:

Logs Explorer supports interactive filtering, viewing and investigating entries in authorized log buckets; it is not the focused action for exporting filtered log streams to a destination; its primary use is filtering operational log records interactively.

D:

Cloud Logging ingests and organizes supported resource and application logs into log buckets and views; that supports centralizing and querying operational logs; the problem to solve concerns exporting filtered log streams to a destination.

Question 21

A maintenance script requires the API permissions of an authorized automation account without activating a downloaded key. What gcloud feature helps?

  1. Grant workload identity user for federation
  2. Use service account impersonation with gcloud
  3. Restrict federation provider attributes
  4. Use Workload Identity Federation

Explanation

Correct Answer

B:

Gcloud supports service-account impersonation flags to request short-lived credentials when authorized; for the stated workload, the practical result is using controlled per-command service-account impersonation.

Incorrect Answers

A:

Workload Identity User can permit eligible federated identities to access a target service account through supported federation flows; the supported outcome is permitting trusted workload federation to impersonate target identity, while the requested result is using controlled per-command service-account impersonation.

C:

Workload identity provider attribute conditions restrict accepted external identity assertions; the decision here is about using controlled per-command service-account impersonation, not enforcing attribute-based identity federation conditions.

D:

The alternative would address federating non-Google workload credentials; Workload Identity Federation exchanges eligible external workload identities for short-lived Google Cloud credentials; the question instead requires using controlled per-command service-account impersonation.

Question 22

A scheduled cleanup removed a critical file two hours ago and soft delete is active. Which storage operation is relevant?

  1. Grant Storage Object Admin
  2. Restore a soft-deleted Cloud Storage object
  3. Grant Storage Object Creator
  4. Use object holds
  5. Configure Cloud Storage lifecycle deletion
  6. Use gcloud storage cp

Explanation

Correct Answer

B:

The requested administrative outcome is recovering retained deleted object data; Soft-deleted objects can be restored within their applicable retention period using supported restore workflows.

Incorrect Answers

A:

Storage Object Admin grants object management permissions without inherently granting all project administration rights; this governs performing full object-level data operations, whereas the stated objective is recovering retained deleted object data.

C:

Storage Object Creator supports creating objects without granting general read or delete permissions; its purpose differs: granting create-only object access is separate from recovering retained deleted object data.

D:

Object holds block eligible object deletion until the hold condition is cleared; this governs pausing deletion of selected objects, whereas the stated objective is recovering retained deleted object data.

E:

Cloud Storage lifecycle rules can remove objects when configured age or other conditions are satisfied; its purpose differs: implementing age-based object cleanup is separate from recovering retained deleted object data.

F:

Gcloud storage cp copies files and supported objects between local storage and Cloud Storage paths; Applying it would target uploading object data with the CLI, leaving the separate need for recovering retained deleted object data.

Question 23

An administrator marked a project for deletion yesterday and wants its supported resources back before permanent removal. What action should be investigated?

  1. Use project lifecycle restore window
  2. Use organization-level Cloud Asset Inventory search
  3. Use a separate project for prod and dev
  4. Use the immutable project number

Explanation

Correct Answer

A:

Projects can generally be undeleted during a limited recovery interval before final deletion and data loss; this is the specific mechanism used for recovering a recently deleted project.

Incorrect Answers

B:

Cloud Asset Inventory searches can target supported ancestor scopes including organizations and folders; it is appropriate for broadening asset discovery to an organization ancestor; here, the deciding requirement is recovering a recently deleted project.

C:

Separate projects provide independent administration, many quota scopes and clearer billing and permission boundaries; it concerns separating development from production boundaries, and its normal effect does not provide recovering a recently deleted project.

D:

The project number is a Google-assigned numeric identifier distinct from a user-selected project ID; that supports passing a generated numeric project identity; the problem to solve concerns recovering a recently deleted project.

Question 24

A staff member cannot install the CLI on a restricted workstation but must run kubectl and gcloud tasks. Which environment is appropriate?

  1. Use Cloud Shell
  2. Use gcloud auth application-default login
  3. Use gcloud services enable
  4. Set gcloud's active project

Explanation

Correct Answer

A:

What matters is performing administration from a managed web shell; Cloud Shell provides a browser terminal with Google Cloud CLI tools and user-based authentication integration.

Incorrect Answers

B:

Application Default Credentials are discovered by client libraries separately from the CLI's normal active credential store; it is relevant when setting up local Application Default Credentials, not when the primary need is performing administration from a managed web shell.

C:

The gcloud services enable command activates named Service Usage APIs in the selected project; it is not the focused action for performing administration from a managed web shell; its primary use is automating project service activation.

D:

The active gcloud core/project property determines the default project for commands that honor it; the supported outcome is setting the default gcloud project context, while the requested result is performing administration from a managed web shell.

Question 25

Legal records must not be deleted before a specified minimum retention period regardless of ordinary lifecycle rules. What bucket control fits?

  1. Use Storage Transfer Service
  2. Use Cloud Storage signed URLs
  3. Use a Cloud Storage retention policy
  4. Use Cloud Storage public access prevention
  5. Use Cloud Storage uniform bucket-level access

Explanation

Correct Answer

C:

Bucket retention policies enforce minimum retention periods for supported objects and can be locked for stronger controls; this corresponds to enforcing minimum retention for objects, not a separate lifecycle action.

Incorrect Answers

A:

Storage Transfer Service orchestrates supported large-scale transfers into and between storage systems; the decision here is about enforcing minimum retention for objects, not migrating bulk external object data.

B:

Signed URLs authorize specific Cloud Storage requests for a bounded time using a signing identity; the scenario specifies enforcing minimum retention for objects, which differs from delegating temporary object access via signed request.

D:

For preventing anonymous Cloud Storage grants, this could be relevant; Public access prevention disallows public exposure through relevant Cloud Storage access mechanisms; the actual request concerns enforcing minimum retention for objects.

E:

This alternative focuses on standardizing object authorization through IAM; Uniform bucket-level access turns off object ACLs so IAM governs access to bucket objects; the stem instead asks for enforcing minimum retention for objects.

Question 26

A globally distributed transactional system needs horizontal scaling and strong relational consistency. Which managed database fits?

  1. Use AlloyDB for PostgreSQL
  2. Use Cloud SQL point-in-time recovery
  3. Use Spanner
  4. Use Cloud SQL high availability

Explanation

Correct Answer

C:

The requested administrative outcome is providing scalable strongly consistent relational transactions; Spanner offers managed distributed relational databases with horizontal scale and strong consistency.

Incorrect Answers

A:

For deploying managed PostgreSQL-compatible high performance, this could be relevant; AlloyDB for PostgreSQL is a managed PostgreSQL-compatible service with a purpose-built storage and compute architecture; the actual request concerns providing scalable strongly consistent relational transactions.

B:

Point-in-time recovery uses supported transaction log capabilities to restore a Cloud SQL database state near a specified time; it is appropriate for restoring a relational database using transaction logs; here, the deciding requirement is providing scalable strongly consistent relational transactions.

D:

Cloud SQL regional high availability uses an eligible standby in another zone for failover; that mechanism handles running an HA regional Cloud SQL instance; it does not configure providing scalable strongly consistent relational transactions.

Question 27

A build engineer needs to run commands as a target service account without receiving its long-lived private key. Which authorization approach fits?

  1. Use IAM service-account impersonation roles
  2. Grant workload identity user for federation
  3. Use short-lived access tokens
  4. Use service account delegation chain

Explanation

Correct Answer

A:

Service account impersonation lets authorized principals mint short-lived credentials for an account using supported IAM roles; this is relevant because the outcome sought is allowing time-limited identity impersonation.

Incorrect Answers

B:

Workload Identity User can permit eligible federated identities to access a target service account through supported federation flows; it is appropriate for permitting trusted workload federation to impersonate target identity; here, the deciding requirement is allowing time-limited identity impersonation.

C:

Short-lived OAuth access tokens restrict credential lifetime and can be generated using supported identity mechanisms; its operational role is limiting credential validity through expiration; the needed capability is allowing time-limited identity impersonation.

D:

IAM Credentials supports delegated impersonation chains when each principal has required token creation permissions; the supported outcome is performing authorized chained service-account impersonation, while the requested result is allowing time-limited identity impersonation.

Question 28

Application logs contain numeric response durations; an engineer needs a metric distribution of those values. What type should be configured?

  1. Create a metric-threshold alert
  2. Use log-based distribution metric
  3. Create a Logs Router sink to BigQuery
  4. Configure Ops Agent on a VM

Explanation

Correct Answer

B:

Distribution log-based metrics extract numerical values from log entries to record value distributions; the decisive property here is extracting numeric distributions from log fields.

Incorrect Answers

A:

Metric-threshold conditions compare time series with configured values and duration windows; this governs triggering alerts from metric values, whereas the stated objective is extracting numeric distributions from log fields.

C:

Logs Router sinks select entries using filters and export to authorized supported destinations; it would help with streaming matching log records to analytics storage, but it does not directly implement extracting numeric distributions from log fields.

D:

The Ops Agent gathers supported guest metrics and logs and sends them to Google Cloud Observability; it is not the focused action for extracting numeric distributions from log fields; its primary use is instrumenting VM operating-system telemetry.

Question 29

A single deployment template should accept per-environment values without copying and editing resource blocks. What should be used?

  1. Use a version-controlled IaC repository
  2. Use Terraform outputs
  3. Use Terraform modules
  4. Use Terraform variables

Explanation

Correct Answer

D:

Terraform input variables let callers supply environment-specific configuration to reusable definitions; Applied in this case, it delivers configuring reusable Terraform modules with inputs.

Incorrect Answers

A:

Version control tracks infrastructure definitions, reviews and history across deployments; it is relevant when managing cloud configuration through versioned files, not when the primary need is configuring reusable Terraform modules with inputs.

B:

Terraform outputs publish selected values from a configuration or module for downstream use; that mechanism handles passing provisioned resource identifiers to consumers; it does not configure configuring reusable Terraform modules with inputs.

C:

Terraform modules encapsulate resource definitions and input/output interfaces for reuse; the supported outcome is standardizing infrastructure through reusable components, while the requested result is configuring reusable Terraform modules with inputs.

Question 30

An application has excessive read traffic but writes must continue to a primary relational database. Which Cloud SQL topology helps?

  1. Use Cloud SQL high availability
  2. Use BigQuery
  3. Use a Cloud SQL private IP
  4. Use Cloud SQL read replicas

Explanation

Correct Answer

D:

Cloud SQL read replicas provide asynchronously replicated read capacity and do not directly handle primary writes; for the stated workload, the practical result is offloading read-only queries from the primary.

Incorrect Answers

A:

Cloud SQL regional high availability uses an eligible standby in another zone for failover; this governs providing managed database failover across zones, whereas the stated objective is offloading read-only queries from the primary.

B:

BigQuery is a managed analytical data warehouse designed for scalable SQL workloads; its operational role is querying large analytical datasets; the needed capability is offloading read-only queries from the primary.

C:

Cloud SQL private IP enables private connectivity through the configured network integration; it is not the focused action for offloading read-only queries from the primary; its primary use is connecting to Cloud SQL through private addresses.

Associate Cloud Engineer Practice Tests