All practice questions
1591 questions
An organization has a Cloud Run service named `invoice-service` deployed in the `us-central1` region. You need to configure this Cloud Run service so that all outbound network traffic from the instances is routed through an existing Serverless VPC Access connector named `vpc-conn`. Which `gcloud` command should you run to accomplish this task?
A DevOps engineer is scripting the deployment of a Compute Engine instance using the `gcloud` CLI. The VM requires a local initialization script `./init.sh` to run at boot time and must run under an existing custom service account `[email protected]`. Which TWO `gcloud compute instances create` flags should be included in the command execution?
Select all that apply
A network administrator needs to route all outbound internet traffic from a private subnet through a custom network virtual appliance (NVA) instance named 'nva-gateway' located in zone 'us-central1-a'. The route must be named 'route-outbound-nva', reside in the custom VPC network 'prod-vpc', target destination '0.0.0.0/0', and have a priority of 800. Which gcloud command should the administrator run to implement this custom route?
An application developer requires access to retrieve secret payloads stored in Secret Manager within project `proj-backend-services` to perform local integration testing. The security team mandates that access must adhere strictly to the Principle of Least Privilege without granting unnecessary permissions or broader hierarchy access. Which IAM role assignment should be granted to the developer?
A DevOps team needs to allow a cloud administrator ([email protected]) to execute infrastructure provisioning scripts against a target Google Cloud project from their local machine. Enterprise security policies strictly prohibit downloading or storing long-lived service account keys locally. The administrator must impersonate a dedicated deployment service account ([email protected]) using short-lived credentials. Which TWO actions must be completed to grant and use service account impersonation for this workflow?
Select all that apply
A Cloud Engineer needs to establish secure outbound internet connectivity for internal workload instances without assigning public IP addresses. The engineer must build a custom Virtual Private Cloud (VPC) network and enable Cloud NAT for a subnet in region `us-central1` using the `gcloud` CLI.
What is the correct logical sequence of steps to provision this networking architecture?
Drag items to arrange them in the correct order
A DevOps engineer needs to manage an existing Cloud Run service named `report-generator-service` deployed in the `europe-west1` region. To optimize performance during morning peak hours, the engineer must ensure that at least 5 container instances remain warm and ready to serve requests immediately. Additionally, to enforce security policy, access must be limited exclusively to a dedicated worker service account named `[email protected]`. Which TWO `gcloud` commands should the engineer execute to achieve this configuration?
Select all that apply
A cloud engineer needs to configure network access for administrative maintenance on private Compute Engine instances in a custom VPC network. The instances do not have external IP addresses. The engineer wants to enable secure SSH access through Identity-Aware Proxy (IAP) TCP forwarding without exposing the instances to the public internet. Which two operational steps must be performed to meet these networking requirements?
Select all that apply
An Site Reliability Engineering (SRE) team is managing a fleet of GKE microservices that output custom application logs to Cloud Logging. The team needs to configure automated real-time incident routing whenever application logs register a severity of `ERROR`. The solution must trigger an alerting mechanism that sends notifications directly to a Cloud Pub/Sub topic for downstream automated remediation. Which TWO actions must the team perform to achieve this requirement using Google-recommended practices?
Select all that apply
A cloud engineer needs to configure a Google Compute Engine VM instance to securely access objects in a Cloud Storage bucket following Google Cloud security best practices and least-privilege principles. Arrange the procedural steps in the correct sequential order from first to last.
Drag items to arrange them in the correct order
An automated build pipeline's service account requires access to project `proj-artifact-deploy-409`. The service account must be able to push container images to Artifact Registry repositories and update existing Cloud Run services with new container revisions. It must not be granted permissions to modify other infrastructure components or manage IAM policies. Which TWO predefined roles should be granted to the service account at the project level to adhere to the principle of least privilege? (Select TWO.)
Select all that apply
A cloud engineer is provisioning a custom-mode Virtual Private Cloud (VPC) network named `production-vpc` using the `gcloud` CLI. A new subnet named `data-subnet` must be deployed in `us-central1` with the IP range . Virtual machine instances deployed in this subnet will not have external IP addresses but must be able to communicate with Google Cloud APIs and services. Furthermore, an ingress firewall rule named `allow-internal-pg` must be configured to allow TCP port 5432 traffic from to instances tagged `postgres-db`, overriding a baseline rule with priority 1000 that denies all ingress traffic to database nodes. Which two `gcloud` CLI commands or flags are required to complete this deployment correctly? (Select TWO.)
Select all that apply
A DevOps engineer is updating an automated data pipeline script that uploads nightly log archives to a Cloud Storage bucket named `analytics-logs-prod`. The security team recently enabled Uniform Bucket-Level Access (UBLA) on this bucket to satisfy compliance requirements. Following this change, the pipeline script fails during file upload when executing `gcloud storage cp` with the `--canned-acl=bucket-owner-full-control` flag. How should the engineer resolve this pipeline failure while following Google Cloud security best practices?
A cloud engineer needs to deploy a custom Compute Engine virtual machine instance named report-worker in zone us-central1-a. The instance requires a custom machine configuration using the E2 machine family with 4 vCPUs and 16 GB (16,384 MB) of RAM. Which gcloud command should the engineer execute to create this VM instance?
A cloud engineer needs to ensure that no Virtual Machine instances created inside any project within the 'Data-Analytics' folder can be provisioned with external IP addresses. Developers currently hold project-level permissions that allow them to configure network interfaces. Which configuration should the engineer implement to enforce this restriction across all current and future projects in the folder?
A cloud administration team manages a resource hierarchy where a specific folder named `Analytics-Prod` contains multiple sensitive data processing projects. Security guidelines require that no Compute Engine virtual machine instances within this folder are assigned external IP addresses, and all Cloud Storage buckets created inside this folder must strictly use Uniform Bucket-Level Access. These restrictions must automatically apply to all current and future projects in the `Analytics-Prod` folder, regardless of root-level defaults. Which TWO actions should the administrator take to implement these constraints using Google Cloud Organization Policies?
Select all that apply
A cloud administrator recently deployed a new revision named `orders-v2` for an existing Cloud Run service named `order-processor` in the `us-central1` region. During testing, the administrator specified the `--no-traffic` flag, so 100% of production traffic is still being served by the previous revision `orders-v1`. After verifying that `orders-v2` functions correctly, the administrator needs to immediately route all incoming production traffic to `orders-v2`. Which `gcloud` command should the administrator execute to achieve this target configuration?
A financial services company is deploying a multi-tier web application across a fleet of Linux virtual machines on Compute Engine. To comply with operational SLAs and security auditing guidelines, the infrastructure team must collect system-level memory utilization, disk space metrics, and custom syslog files from the instances into Google Cloud Observability. The implementation must follow Google Cloud recommended practices for telemetry agent configuration and IAM access management. Which deployment strategy should the Cloud Engineer implement?
An enterprise operations team needs to allow a database administrator to create, update, and manage Cloud SQL database instances within project `proj-finance-db-4091`. The administrator must not receive read access to data stored inside the databases or permissions to manage non-database cloud resources. To adhere strictly to the Principle of Least Privilege, which identity configuration should you apply?
A company is migrating a fleet of Linux Compute Engine virtual machines to Google Cloud. The operations team needs to collect system telemetry—including OS-level memory utilization, detailed disk metrics, and system log entries—and send this telemetry to Cloud Monitoring and Cloud Logging. The implementation must follow Google-recommended best practices for agent deployment and adhere to the principle of least privilege for access control. Which TWO actions must you perform to satisfy these requirements? (Select TWO.)
Select all that apply