Tüm alıştırma soruları

1591 soru

Soru 1121Soru

An infrastructure team needs to secure an existing Cloud Run service named `order-processor` deployed in the `us-central1` region. The service must only accept network traffic originating from internal Virtual Private Cloud (VPC) networks within the same project, and execution permissions must be granted exclusively to an automated service account named `[email protected]` following the principle of least privilege. Which TWO configuration steps should the team perform?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Update the Cloud Run service ingress setting using `gcloud run services update order-processor --ingress=internal --region=us-central1`.; Grant the Cloud Run Invoker predefined role (`roles/run.invoker`) to `serviceAccount:[email protected]` on the `order-processor` service resource.

Cevap

To properly secure the Cloud Run service, restrict network access to internal VPC traffic using `gcloud run services update order-processor --ingress=internal --region=us-central1`, and grant the predefined Cloud Run Invoker role (`roles/run.invoker`) to the dedicated service account on the resource.
Securing a Cloud Run service according to operational best practices requires updating ingress settings via `gcloud run services update --ingress=internal` and binding the standard predefined role `roles/run.invoker` directly to the caller service account on the resource level.

Adım Adım Çözüm

1
Configure network access controls for the Cloud Run service.
Network ingress is restricted to internal VPC traffic via `--ingress=internal`.
Prevents unauthorized external internet clients from directly invoking the HTTP endpoint.
2
Configure identity-based access control using fine-grained IAM roles.
The identity `[email protected]` receives `roles/run.invoker` on the `order-processor` resource.
Enforces least-privilege access by allowing only the authorized caller service account to invoke the service.

Anahtar Kavram

Managing Cloud Run Access Control and Ingress Policies
Soru 1122Soru

A research institute is designing a Google Kubernetes Engine (GKE) cluster architecture to execute large-scale, fault-tolerant batch analysis jobs. The workloads require specialized host-level OS kernel modifications via custom `sysctl` settings on the underlying node OS, and the organization wants to minimize compute infrastructure expenses as much as possible. Which GKE cluster architecture should the cloud engineer select?

Cevabı ve açıklamayı göster

Cevap: Provision a GKE Standard cluster with a dedicated node pool configured to use Spot VMs.

Cevap

Provision a GKE Standard cluster with a dedicated node pool configured to use Spot VMs.
GKE Standard mode provides administrative access and flexibility needed to customize node OS configurations, such as custom sysctl settings. Combining GKE Standard with Spot VMs in node pools satisfies the cost minimization requirement for fault-tolerant workloads.

Adım Adım Çözüm

1
Evaluate operational mode requirements (Autopilot vs. Standard)
GKE Standard must be selected because the workload requires custom node OS kernel modifications (sysctl settings), which are restricted in GKE Autopilot.
GKE Autopilot locks down the underlying host nodes to ensure security and automated management, prohibiting host-level custom OS modifications.
2
Evaluate compute cost optimization options for fault-tolerant workloads
Configure the node pool to use Spot VMs.
Spot VMs provide up to 60-91% discounts compared to standard On-Demand instances, making them ideal for fault-tolerant, stateless batch processing jobs.

Anahtar Kavram

Selecting between GKE Standard and Autopilot based on node OS customization constraints and leveraging Spot VMs for cost-effective batch workloads.
Soru 1123Soru

A Site Reliability Engineering team maintains a Google Kubernetes Engine (GKE) cluster hosted in a custom Virtual Private Cloud (VPC) named `corp-vpc` in the `us-east1` region. An existing Cloud NAT gateway named `nat-gateway-us-east1` configured on Cloud Router `nat-router` currently handles egress traffic, but was initially deployed using the `--nat-primary-subnet-ip-ranges` flag. After adding a new secondary IP range for GKE Pods on `subnet-analytics`, traffic originating from Pods in this secondary range fails to reach external services. Which command should the engineer execute to enable Internet egress for the secondary IP range while preserving existing NAT functionality?

Cevabı ve açıklamayı göster

Cevap: gcloud compute routers nats update nat-gateway-us-east1 --router=nat-router --region=us-east1 --nat-all-subnet-ip-ranges

Cevap

Execute `gcloud compute routers nats update nat-gateway-us-east1 --router=nat-router --region=us-east1 --nat-all-subnet-ip-ranges` to update the Cloud NAT gateway to include all primary and secondary subnet IP ranges.
Executing `gcloud compute routers nats update` with `--nat-all-subnet-ip-ranges` reconfigures the existing Cloud NAT gateway on the designated Cloud Router so that all primary and secondary subnet IP ranges in the region (including GKE Pod ranges) are allocated source NAT addresses for internet egress.

Adım Adım Çözüm

1
Identify the cause of egress traffic failure for the GKE Pod secondary IP range.
Cloud NAT was deployed with `--nat-primary-subnet-ip-ranges`, which explicitly excludes secondary subnet ranges used by GKE Pod alias IPs.
By default or when configured with primary-only flags, Cloud NAT will not allocate source NAT addresses for secondary IP ranges.
2
Determine the proper gcloud CLI command hierarchy for modifying Cloud NAT configurations.
Cloud NAT is a sub-resource of Cloud Router, managed using `gcloud compute routers nats update`.
Executing operations directly on `gcloud compute nats` will fail due to invalid command syntax.
3
Apply the `--nat-all-subnet-ip-ranges` flag to the Cloud NAT configuration.
The gateway updates dynamically to translate traffic from both primary subnet ranges and secondary pod IP ranges without downtime.
This flag ensures complete coverage across all current and future subnets and secondary ranges within the designated VPC and region.

Anahtar Kavram

Managing Cloud NAT egress policies for secondary subnet IP ranges via gcloud CLI
Soru 1124Soru

An organization is setting up a centralized compliance logging architecture in Google Cloud. An engineer configures a Cloud Logging Log Router sink in Project A to route all data access audit logs to a Cloud Storage bucket located in a dedicated security storage project, Project B. After creating the sink, logs fail to appear in the destination Cloud Storage bucket. The engineer confirms that the destination bucket path is correct, the sink filter is properly defined, and the bucket exists. Following the principle of least privilege, which action should the engineer take to resolve this issue and ensure logs are successfully written?

Cevabı ve açıklamayı göster

Cevap: Grant the Storage Object Creator role on the destination Cloud Storage bucket in Project B to the writer identity service account generated by the Log Router sink in Project A.

Cevap

Grant the Storage Object Creator role on the destination Cloud Storage bucket in Project B to the writer identity service account generated by the Log Router sink in Project A.
When a Log Router sink is configured in Google Cloud Logging, a unique service account known as the sink's writer identity is created. When exporting logs across projects to a Cloud Storage bucket, the destination bucket must grant write permissions (specifically `roles/storage.objectCreator`) to this service account identity. This ensures compliance with the principle of least privilege while enabling successful log ingestion.

Adım Adım Çözüm

1
Identify the service account identity used by Cloud Logging Log Router.
When a sink is created in Cloud Logging, GCP assigns a unique writer identity service account (formatted as serviceAccount:[email protected]).
Log Router exports run under this dedicated service account identity rather than instance or default project service accounts.
2
Determine the destination permissions required for cross-project Cloud Storage log exports.
The destination storage bucket requires permissions for the sink's writer identity to write log files into the bucket.
Cross-project log export requires explicit authorization on the destination resource.
3
Apply the principle of least privilege.
Granting `roles/storage.objectCreator` on the specific destination bucket allows object creation without granting excess permissions across Project B.
This satisfies security requirements and enables proper log ingestion.

Anahtar Kavram

Cross-project Cloud Logging Log Router Sink Authorization
Soru 1125Soru

A Cloud Engineer needs to migrate a local Terraform state file to a Google Cloud Storage (GCS) remote backend for a production deployment. Place the steps required to complete this migration in the correct execution order.

Öğeleri doğru sıraya koymak için sürükleyin

Cevabı ve açıklamayı göster

Cevap

To migrate local Terraform state to a GCS remote backend, first provision the GCS bucket with versioning enabled, then define the backend "gcs" block in the Terraform code, run `terraform init` to reconfigure the backend, and lastly confirm the prompt to copy local state to GCS.
The correct sequence starts by provisioning the GCS storage bucket with object versioning enabled. Next, the engineer updates the Terraform code with a `backend "gcs"` block pointing to the bucket. Then, running `terraform init` prompts Terraform to recognize the new remote backend. Finally, confirming the migration prompt transfers existing local state into the GCS bucket.

Adım Adım Çözüm

1
Create the GCS bucket with Object Versioning enabled.
A destination GCS bucket is ready to safely store state files with historical recovery capability.
Terraform cannot auto-create the remote backend bucket during backend initialization.
2
Define the backend "gcs" block in the Terraform configuration.
The Terraform root module is configured to point to the created GCS bucket.
Terraform requires explicit backend parameters to locate where state should be persisted.
3
Execute `terraform init`.
Terraform detects the change from local backend to GCS backend.
Re-initialization triggers the backend reconfiguration workflow in Terraform CLI.
4
Approve the state migration prompt.
Existing local state is securely uploaded to the GCS bucket and local state is updated.
Confirming ensures state continuity so existing managed infrastructure resources are not lost or re-created.

Anahtar Kavram

Terraform Remote State Migration to Google Cloud Storage Backend
Soru 1126Soru

An application developer needs to receive an automated email notification whenever a specific error code string appears in the log stream of a Google Cloud application. What is the Google-recommended method to accomplish this requirement?

Cevabı ve açıklamayı göster

Cevap: Create a log-based counter metric matching the error string filter, and create a Cloud Monitoring alerting policy based on that metric with an email notification channel.

Cevap

Create a log-based counter metric matching the error string filter, and create a Cloud Monitoring alerting policy based on that metric with an email notification channel.
The standard solution in Google Cloud Observability for alerting on specific log contents is to define a log-based counter metric based on a Cloud Logging filter query, then attach a Cloud Monitoring alerting policy with an email notification channel to that metric.

Adım Adım Çözüm

1
Filter log entries in Cloud Logging
Identify the precise log entries containing the required error code string using a log filter query.
Log-based metrics extract structured data or count events from matching log entries.
2
Create a log-based metric
A counter metric is generated that increments whenever a matching log entry arrives.
Cloud Monitoring requires a metric stream to define threshold condition alerts.
3
Configure an alerting policy and notification channel
Set a metric threshold condition (> 0) and attach an email notification channel.
When the metric triggers upon detecting the error log pattern, Cloud Monitoring automatically dispatches an email notification.

Anahtar Kavram

Log-based Metrics and Alerting Policies
Tahmini Süre:50s
Soru 1127Soru

A DevOps engineer manages a stateless web application deployed on a Google Kubernetes Engine (GKE) cluster. During peak traffic events, incoming traffic triggers additional Pod creation, but several newly created Pods remain stuck in a Pending state with a reason of insufficient CPU resources. The engineer wants the GKE infrastructure to automatically add Compute Engine virtual machine instances to the cluster whenever Pods cannot be scheduled due to resource starvation. Which operational action should the engineer take?

Cevabı ve açıklamayı göster

Cevap: Enable Cluster Autoscaler on the node pool to automatically adjust the number of nodes based on unschedulable Pod demand.

Cevap

Enable Cluster Autoscaler on the node pool to automatically adjust the number of nodes based on unschedulable Pod demand.
Cluster Autoscaler continuously checks for Pods that are unschedulable due to resource limitations. Upon detecting pending Pods, it resizes the node pool by adding Compute Engine instances so that the Pods can be scheduled successfully.

Adım Adım Çözüm

1
Analyze the cause of the Pending Pod status
Pods are unschedulable because existing cluster nodes do not have enough remaining allocatable CPU.
When requested CPU resources exceed cluster capacity, the Kubernetes scheduler leaves Pods in a Pending state.
2
Differentiate between workload scaling and infrastructure scaling
Cluster Autoscaler manages the node pool size (infrastructure), whereas Horizontal Pod Autoscaler manages Pod replica counts (workload).
To resolve node capacity limits for unschedulable Pods, infrastructure-level autoscaling via Cluster Autoscaler is required.

Anahtar Kavram

GKE Cluster Autoscaler vs Horizontal Pod Autoscaler
Soru 1128Soru

A security policy prohibits developers from creating or downloading private service account keys. An administrator needs to allow a developer's identity to temporarily generate short-lived credentials for a target service account to execute deployment tasks. Which IAM role should be granted to the developer's identity on the target service account?

Cevabı ve açıklamayı göster

Cevap: Service Account Token Creator (roles/iam.serviceAccountTokenCreator)

Cevap

Granting the Service Account Token Creator (roles/iam.serviceAccountTokenCreator) role on the target service account.
Granting the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) on the target service account enables an authorized principal to generate short-lived OAuth2 tokens and impersonate the service account securely without creating or downloading private keys.

Adım Adım Çözüm

1
Identify the security requirement.
The requirement demands identity delegation via impersonation to mint short-lived tokens while avoiding long-lived private key creation.
Keyless authentication via service account impersonation aligns with GCP security best practices.
2
Select the appropriate fine-grained IAM role.
The Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) provides permission to create OAuth2 access tokens and sign payloads as the target service account.
Binding this role on the specific service account resource adheres strictly to the principle of least privilege.

Anahtar Kavram

Configuring Service Account Impersonation
Soru 1129Soru

A company is configuring access for a site reliability engineer (SRE) who needs to create, modify, and delete Google Kubernetes Engine (GKE) clusters and node pools in a single Google Cloud project named `k8s-platform-prod`. The engineer must not be able to modify project IAM policies, alter billing account settings, or manage unrelated services like Cloud Storage or BigQuery. Following Google Cloud recommended security practices and the principle of least privilege, which IAM configuration should you implement?

Cevabı ve açıklamayı göster

Cevap: Grant the Kubernetes Engine Admin (`roles/container.admin`) role to the engineer on the `k8s-platform-prod` project.

Cevap

Grant the predefined role Kubernetes Engine Admin (`roles/container.admin`) to the user at the specific project level (`k8s-platform-prod`).
Granting the predefined Kubernetes Engine Admin role (`roles/container.admin`) at the project level provides all necessary permissions to manage GKE clusters and node pool resources within `k8s-platform-prod` while ensuring the user cannot alter project IAM policies, modify billing account configurations, or manage non-container resources.

Adım Adım Çözüm

1
Identify the required functional capabilities for the principal.
The engineer requires full management control over GKE clusters and node pools.
Understanding the specific operational scope determines the appropriate IAM role type.
2
Select a role adhering to the Principle of Least Privilege.
Choose the predefined role `roles/container.admin` over primitive roles (`roles/owner` or `roles/editor`).
Predefined roles group granular permissions tailored to specific job functions, preventing over-privileging across unrelated GCP services.
3
Determine the narrowest required scope within the GCP Resource Hierarchy.
Apply the role binding at the target project level (`k8s-platform-prod`).
Applying the role binding at the parent folder or organization level causes downstream resource hierarchy inheritance, granting unintended access across other projects.

Anahtar Kavram

Principle of Least Privilege using Predefined IAM Roles at Project Scope
Soru 1130Soru

A logistics company is deploying a custom Go-based tracking service to Google Cloud Run. The containerized application inside the image listens on TCP port 80008000, and the deployment policy requires the endpoint to be publicly reachable on the web without requiring IAM authentication. Which TWO configuration options or `gcloud run deploy` command flags should be specified to achieve this outcome?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Specify the `--port=8000` flag during deployment to direct Cloud Run traffic to the container's listening port.; Include the `--allow-unauthenticated` flag during the deployment command.

Cevap

The correct choices are specifying the `--port=8000` flag during deployment and including the `--allow-unauthenticated` flag in the deployment command.
To successfully deploy a container listening on port 8000 and make it publicly reachable, Cloud Run requires configuring the target port via `--port=8000` and permitting public access via `--allow-unauthenticated`.

Adım Adım Çözüm

1
Configure the container ingress port binding
Passing `--port=8000` ensures Cloud Run sets the `PORT` environment variable to 8000 and routes incoming request traffic to port 8000 inside the container.
By default, Cloud Run sends traffic to port 8080 unless explicitly overridden via the `--port` flag.
2
Configure IAM access policy for public invocations
Including `--allow-unauthenticated` grants the `roles/run.invoker` permission to `allUsers`.
Cloud Run services require explicit invoker permissions to allow unauthenticated web traffic.

Anahtar Kavram

Cloud Run deployment configuration flags for custom container port binding and IAM public ingress access control.
Soru 1131Soru

An IoT energy management company is designing a Google Cloud architecture to collect and process telemetry data from millions of smart electric meters. The architecture requires two storage capabilities: first, a scalable NoSQL database optimized for continuous high-throughput writes and low-latency reads of time-series device telemetry; second, block storage for worker Compute Engine virtual machines that provides durable storage surviving instance stops while delivering cost-effective performance. Which TWO Google Cloud storage solutions should be selected to meet these requirements? (Select TWO)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Cloud Bigtable to handle the high-throughput time-series telemetry data ingestion; Balanced Persistent Disk (pd-balanced) attached to the Compute Engine worker instances

Cevap

The correct architecture requires selecting Cloud Bigtable for high-throughput time-series telemetry ingestion and Balanced Persistent Disk (pd-balanced) for durable, cost-effective VM block storage.
Cloud Bigtable provides ideal high-throughput NoSQL storage for time-series IoT data streams, and Balanced Persistent Disk provides durable, cost-effective block storage that persists when Compute Engine virtual machines stop.

Adım Adım Çözüm

1
Evaluate database requirements for smart meter time-series telemetry.
Identify that Cloud Bigtable is the recommended Google Cloud managed NoSQL engine for high-velocity, high-volume time-series data.
Relational options like Cloud SQL do not scale horizontally for massive continuous stream writes as effectively as Bigtable.
2
Evaluate block storage requirements for Compute Engine worker VMs.
Select Balanced Persistent Disk (pd-balanced) for durable block storage.
Balanced Persistent Disks offer durable persistence across VM restarts with a performance-to-cost ratio tailored for general worker nodes, whereas Local SSDs are ephemeral.

Anahtar Kavram

Selecting GCP Database Engines and Block Storage Types
Soru 1132Soru

A system administrator is deploying a managed Cloud SQL instance for an enterprise application. The security policy dictates that the database must communicate strictly within a custom Virtual Private Cloud (VPC) network named 'corp-vpc' and must not have a public IP address. Which TWO actions must be completed to deploy the Cloud SQL instance with private IP connectivity and no public IP?

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Create a private services access connection by allocating an IP address range and peering 'corp-vpc' with the Google services network.; Include the '--network=corp-vpc' and '--no-assign-ip' flags when executing the 'gcloud sql instances create' command.

Cevap

The correct configuration requires establishing a private services access connection between 'corp-vpc' and Google services, and deploying the instance using the 'gcloud sql instances create' command with the '--network=corp-vpc' and '--no-assign-ip' flags.
Deploying a Cloud SQL instance with private IP connectivity requires establishing Private Service Access by peering the custom VPC with Google services, and running the deployment command with '--network' set to the VPC name alongside '--no-assign-ip' to prevent public IP creation.

Adım Adım Çözüm

1
Configure Private Service Access
Allocates an IP address range in 'corp-vpc' and establishes VPC peering with Google managed services.
Cloud SQL instances reside in a Google-managed VPC, so private IP communication requires Private Service Access VPC peering.
2
Execute the instance creation command with appropriate network flags
Deploys the Cloud SQL instance with an internal IP address inside the peered range and prevents public IPv4 allocation.
The '--network=corp-vpc' flag connects the instance to the private network, and '--no-assign-ip' prevents public IP address assignment.

Anahtar Kavram

Provisioning Cloud SQL instances with Private IP and disabling Public IP via gcloud CLI and Private Service Access
Tahmini Süre:1m 30s
Soru 1133Soru

An external security auditor needs read-only access to inspect Compute Engine instance configurations, network interface details, and instance metadata within a specific Google Cloud project named `retail-store-prod`. The auditor must not be permitted to make modifications to any compute resources or access resources outside of this project. Following the principle of least privilege, which IAM role configuration should be granted to the auditor?

Cevabı ve açıklamayı göster

Cevap: Grant the `roles/compute.viewer` predefined role on the `retail-store-prod` project.

Cevap

Grant the `roles/compute.viewer` predefined role bound specifically at the `retail-store-prod` project level.
The correct answer adheres to the principle of least privilege by combining a service-specific predefined role (`roles/compute.viewer`) with the exact scope requested (project level). This ensures the security auditor can inspect Compute Engine instances without gaining access to non-compute services or other projects in the resource hierarchy.

Adım Adım Çözüm

1
Identify the required permissions needed by the principal.
The user requires read-only inspection access restricted strictly to Compute Engine resources.
Understanding the required action prevents over-granting administrative permissions.
2
Select the appropriate role type adhering to least privilege.
Choose the predefined `roles/compute.viewer` role instead of the primitive `roles/viewer` or administrative `roles/compute.admin` role.
Predefined roles offer fine-grained permissions tailored to specific service responsibilities.
3
Determine the narrowest required resource hierarchy scope for the role binding.
Bind the role directly at the `retail-store-prod` project level.
Binding at higher levels like Folders or Organizations causes permission inheritance across unneeded projects.

Anahtar Kavram

Principle of Least Privilege with Predefined Roles and Resource Hierarchy Scoping
Tahmini Süre:1m 30s
Soru 1134Soru

An organization operates a cluster of stateful application servers on Google Compute Engine. The operations team needs to establish a automated, maintenance-free persistent disk backup strategy that takes daily snapshots of all data disks and automatically deletes snapshots older than 30 days. The solution must adhere to the principle of least privilege and avoid administrative overhead from managing custom scripts or third-party cron schedulers. Which approach aligns with Google-recommended best practices for managing Compute Engine resources?

Cevabı ve açıklamayı göster

Cevap: Create a Compute Engine Resource Policy that defines a daily snapshot schedule with a 30-day auto-delete retention policy, and attach this policy to each persistent disk.

Cevap

Creating a Compute Engine Resource Policy defining a daily snapshot schedule with a 30-day retention period and attaching it to the persistent disks is the Google-recommended best practice.
Compute Engine Resource Policies allow cloud administrators to define automated backup schedules and retention windows directly on persistent disks. This native mechanism manages snapshot creation and deletion without requiring custom scripts, cron jobs, or elevated service account permissions.

Adım Adım Çözüm

1
Identify native Google Cloud features for automated disk lifecycle management.
Compute Engine Resource Policies provide built-in snapshot scheduling and automatic retention management.
Using native service capabilities eliminates the need to maintain external cron scripts or third-party scheduling tooling.
2
Evaluate security and access management requirements.
Resource Policies execute within the Compute Engine management control plane without granting broad IAM privileges to workload service accounts.
This maintains strict adherence to the principle of least privilege.
3
Attach the resource policy to the targeted persistent disks.
Snapshots will automatically be generated according to the daily schedule and purged after 30 days.
This fulfills all backup and retention objectives with zero ongoing operational overhead.

Anahtar Kavram

Compute Engine Resource Policies for Persistent Disk Snapshot Schedules
Soru 1135Soru

You are deploying a custom web application on a Compute Engine instance that needs to fetch static files from Cloud Storage and record application logs in Cloud Logging. Following Google Cloud security best practices for service account creation and management, which TWO steps should you take to grant the required permissions? (Select TWO)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Provision a dedicated service account using the gcloud iam service-accounts create command.; Grant the predefined roles roles/storage.objectViewer and roles/logging.logWriter directly to the service account.

Cevap

Create a dedicated service account using gcloud CLI and assign least-privilege predefined roles (roles/storage.objectViewer and roles/logging.logWriter) to it.
The correct approach involves creating a dedicated custom service account and assigning specific predefined IAM roles (`roles/storage.objectViewer` and `roles/logging.logWriter`). Compute Engine instances automatically authenticate workloads using attached service accounts via the metadata server, eliminating the need to store sensitive private key files on disk.

Adım Adım Çözüm

1
Create a dedicated service account using the CLI.
A new service account resource is created within the project.
Dedicated service accounts isolate application identities and prevent over-privileged access.
2
Bind predefined IAM roles to the service account.
The service account gains granular access to read Cloud Storage objects and submit logs to Cloud Logging.
Predefined roles follow the principle of least privilege.
3
Attach the service account to the Compute Engine virtual machine during provisioning.
The virtual machine uses automatically managed metadata service credentials without long-lived keys.
Inside Google Cloud, service accounts attached to VMs authenticate securely via instance metadata.

Anahtar Kavram

Creating service accounts and assigning least-privilege predefined roles for workload authentication.
Tahmini Süre:1m 0s
Soru 1136Soru

A Cloud Engineer is configuring the unified Ops Agent on a fleet of Linux Compute Engine virtual machines (VMs) to ingest custom application logs located at `/var/log/app_telemetry.log` into Cloud Logging. After installing the agent with its default configuration, system metrics and standard syslog entries are correctly appearing in Cloud Observability, but entries from `/var/log/app_telemetry.log` are missing. Which modification to the Ops Agent configuration file (`/etc/google-cloud-ops-agent/config.yaml`) is required to ingest these custom log entries?

Cevabı ve açıklamayı göster

Cevap: Add a receiver of type `files` specifying `/var/log/app_telemetry.log` under `include_paths` in the `logging` section, and reference that receiver in a logging pipeline under `service`.

Cevap

Add a receiver of type `files` specifying `/var/log/app_telemetry.log` under `include_paths` in the `logging` section, and reference that receiver in a logging pipeline under `service`.
To collect non-standard application log files using the unified Google Cloud Ops Agent, you must edit `/etc/google-cloud-ops-agent/config.yaml`. Inside the `logging` section, define a receiver with `type: files` and include the path `/var/log/app_telemetry.log` under `include_paths`. Finally, add this receiver to a pipeline under `logging.service.pipelines` so that the agent routes those log lines to Cloud Logging.

Adım Adım Çözüm

1
Identify the telemetry ingestion mechanism
Recognize that the unified Ops Agent requires custom log sources to be explicitly configured in `/etc/google-cloud-ops-agent/config.yaml`.
By default, the Ops Agent only collects standard system metrics and syslog/journald logs.
2
Configure the receiver for file monitoring
Define a receiver under `logging.receivers` with `type: files` and set `include_paths: ["/var/log/app_telemetry.log"]`.
The `files` receiver type tells the agent to tail specific file paths on the local filesystem.
3
Connect the receiver to the logging service pipeline
Add the newly defined receiver key to `logging.service.pipelines.default_pipeline.receivers`.
Receivers must be bound to an active pipeline in the service section for data to flow to Cloud Logging.

Anahtar Kavram

Ops Agent Custom Logging Configuration
Soru 1137Soru

Your organization is configuring a third-party CI/CD pipeline hosted outside Google Cloud to deploy applications to a Google Cloud project. Company security policies strictly prohibit the creation and download of static, long-lived service account JSON key files. A target service account named [email protected] already exists with the necessary deployment permissions. Which approach should you implement to allow the external pipeline to authenticate and act as the service account while complying with Google security best practices?

Cevabı ve açıklamayı göster

Cevap: Configure Workload Identity Federation by creating a workload identity pool and provider, then grant the external repository principal identity the Workload Identity User role (roles/iam.workloadIdentityUser) on [email protected].

Cevap

Configure Workload Identity Federation by creating a workload identity pool and provider, then grant the external repository principal identity the Workload Identity User role (roles/iam.workloadIdentityUser) on [email protected].
Configuring Workload Identity Federation and binding the Workload Identity User role (roles/iam.workloadIdentityUser) to the external identity directly on the target service account allows short-lived token exchange for secure, keyless authentication.

Adım Adım Çözüm

1
Analyze authentication requirements and security constraints
Identified requirement for external authentication without static service account key generation.
Google Cloud security best practices recommend Workload Identity Federation for workloads running outside Google Cloud.
2
Establish federated trust
A Workload Identity Pool and Provider establish trust with the external identity provider (OIDC/SAML).
This setup allows external identity tokens to be exchanged for short-lived GCP token credentials.
3
Assign least-privilege IAM binding on the service account
Grant roles/iam.workloadIdentityUser to the external identity on the target service account resource.
This allows the external identity to impersonate the specific target service account securely.

Anahtar Kavram

Workload Identity Federation and Service Account Impersonation
Tahmini Süre:2m 0s
Soru 1138Soru

A Cloud Engineer needs to import data into a Cloud SQL for MySQL instance from a SQL dump file stored in a Google Cloud Storage bucket using the gcloud command-line interface. Which sequence of steps represents the correct procedure to execute this operation successfully?

Öğeleri doğru sıraya koymak için sürükleyin

Cevabı ve açıklamayı göster

Cevap

The correct operational sequence begins by retrieving the Cloud SQL instance service account identity, granting that service account the Storage Object Viewer IAM role on the GCS bucket, running the gcloud sql import sql command, and finally verifying the asynchronous operation status.
To import data into Cloud SQL from Cloud Storage, the Cloud SQL instance's managed service account must first be retrieved and granted read permissions on the bucket. Only after IAM permissions are in place can the gcloud sql import sql command succeed, followed by checking operation status for completion.

Adım Adım Çözüm

1
Retrieve Cloud SQL Service Account Identity
Obtained the auto-generated service account email address for the Cloud SQL instance.
Cloud SQL accesses Google Cloud Storage using its own dedicated service account identity rather than user credentials.
2
Assign IAM Bucket Permissions
Assigned roles/storage.objectViewer to the Cloud SQL service account on the destination Cloud Storage bucket.
Cloud SQL requires read access to the GCS object to process the SQL dump during import.
3
Run Database Import Command
Initiated the import job via gcloud sql import sql INSTANCE_NAME gs://BUCKET_NAME/DUMP_FILE.sql.
This tells Cloud SQL to read the dump file from GCS and load the data into the database instance.
4
Verify Operation Status
Confirmed that the import operation reached DONE status without errors.
Import operations run asynchronously in GCP, so verification confirms the database state is updated.

Anahtar Kavram

Cloud SQL Data Import Procedures and IAM Authorization
Soru 1139Soru

A cloud engineer is deploying a custom-mode Virtual Private Cloud (VPC) network named `corp-vpc`. The application team requires ingress TCP traffic on port 8080 to be allowed on Compute Engine instances tagged with `backend` ONLY if the traffic originates from instances tagged with `frontend`. All other ingress traffic on port 8080 to `backend` instances must be explicitly blocked by a fallback rule. Which TWO actions must the engineer take when creating these firewall rules using `gcloud`? (Select TWO.)

Geçerli olan tümünü seçin

Cevabı ve açıklamayı göster

Cevap: Configure `--target-tags=backend` and `--source-tags=frontend` on the ingress allow firewall rule.; Assign a lower numerical priority value (such as 100) to the specific allow rule than the fallback deny rule priority (such as 1000).

Cevap

The cloud engineer must configure `--target-tags=backend` and `--source-tags=frontend` for the ingress allow rule, and ensure the allow rule is assigned a lower numerical priority number (e.g., 100) than the fallback deny rule (e.g., 1000).
Google Cloud firewall rules evaluate from lowest priority number to highest. To ensure an allow rule overrides a default or explicit deny rule, the allow rule must be assigned a lower numerical priority (e.g., 100) compared to the deny rule (e.g., 1000). Additionally, for ingress traffic, `--target-tags` identifies destination instances (`backend`) that receive incoming connections, while `--source-tags` restricts allowed senders (`frontend`).

Adım Adım Çözüm

1
Determine ingress firewall rule direction and tag matching syntax
Identified that target tags mark destination instances (`backend`) and source tags filter originating instances (`frontend`).
In GCP ingress firewall rules, traffic flows from `--source-tags` to `--target-tags`.
2
Evaluate rule priority ordering in GCP VPC networks
Confirmed that rule priority values range from 0 to 65535, where lower numbers represent higher precedence.
To ensure the specific allow rule takes precedence over a broader fallback deny rule, the allow rule must have a smaller priority integer.

Anahtar Kavram

GCP VPC Firewall Rule Priority Ordering and Target/Source Tag Rules
Soru 1140Soru

A Cloud Engineer needs to add an additional non-boot persistent disk to an existing running Linux Compute Engine VM instance named `analytics-vm`. The persistent disk `log-data-disk` has already been created in the same zone. Arrange the administrative steps in the correct chronological sequence to attach, format, mount, and configure persistent mounting across reboots for this disk.

Öğeleri doğru sıraya koymak için sürükleyin

Cevabı ve açıklamayı göster

Cevap

The correct sequence begins with attaching the disk via gcloud, SSHing into the instance to identify the OS device path, formatting the raw disk with ext4, creating a directory to mount the filesystem, and appending an entry with the disk's UUID to /etc/fstab for reboot persistence.
To successfully provision and mount a secondary persistent disk on Compute Engine, infrastructure-level attachment (`gcloud compute instances attach-disk`) must happen first. Once attached, an SSH session allows inspecting device paths inside the Linux kernel, formatting the raw device with `mkfs.ext4`, mounting it to a newly created mount point directory, and lastly obtaining its UUID via `blkid` to update `/etc/fstab` so the mount configuration persists across VM reboots.

Adım Adım Çözüm

1
Attach the persistent disk to the VM instance using gcloud
The block storage device `log-data-disk` is connected to the `analytics-vm` virtual machine.
Infrastructure level attachment must occur before the VM operating system can detect or manage the disk.
2
SSH into the VM instance and identify the attached disk device node
The block device identifier (such as `/dev/disk/by-id/google-log-data-disk`) is determined inside Linux.
Operating system utilities require the exact device node path to perform formatting and mounting operations.
3
Format the raw disk device with the ext4 filesystem
An ext4 filesystem structure is initialized on the raw block device.
Unformatted block storage must be initialized with a supported filesystem structure before storing files.
4
Create a target directory and mount the filesystem
The disk is mounted and becomes accessible at `/mnt/disks/log-data`.
Mounting attaches the formatted filesystem to a directory point in the Linux file system hierarchy.
5
Retrieve the UUID with blkid and update /etc/fstab
An `/etc/fstab` entry is added referencing the disk's UUID.
Manual mount commands are non-persistent; configuring `/etc/fstab` ensures the operating system automatically mounts the volume after a reboot.

Anahtar Kavram

Attaching, formatting, mounting, and configuring reboot persistence for secondary Compute Engine disks
ÖncekiSayfa 57 / 80Sonraki
Tüm alıştırma soruları — Google Cloud Associate Cloud Engineer | Examkin