Question

Difficulty: HardManaging Cloud Run Resources

A cloud engineer is configuring operational access and network controls for an existing Cloud Run service named `inventory-service`. The service must fulfill two operational requirements: first, inbound network traffic must be restricted so that it accepts requests only from internal VPC networks and Google Cloud HTTP(S) Load Balancing; second, members of the developer group `[email protected]` must be granted administrative permission to deploy new container revisions and modify traffic splits without receiving broad administrative access across the entire project.

Which TWO actions should the cloud engineer execute? (Select TWO.)

  1. Run `gcloud run services update inventory-service --ingress=internal-and-cloud-load-balancing` to configure the ingress settings.Answer
  2. Grant the `roles/run.developer` IAM role to `[email protected]` on the Cloud Run service resource.Answer
  3. C
    Grant the primitive `roles/editor` role to `[email protected]` at the GCP project level.
  4. D
    Execute `gcloud functions deploy inventory-service --ingress-settings=internal-only` to restrict service ingress.

Answer

The correct operational steps are to update the Cloud Run service ingress setting using `gcloud run services update inventory-service --ingress=internal-and-cloud-load-balancing` and to grant the `roles/run.developer` role to `[email protected]` on the resource.
Configuring Cloud Run ingress with `gcloud run services update inventory-service --ingress=internal-and-cloud-load-balancing` restricts traffic to internal VPC callers and external load balancers. Concurrently, assigning the predefined `roles/run.developer` role to the developer group provides the specific permissions required to deploy revisions and manage traffic split percentages without violating the principle of least privilege.

Step-by-Step Solution

1
Identify the proper gcloud CLI command and flag for restricting Cloud Run ingress traffic.
The command `gcloud run services update inventory-service --ingress=internal-and-cloud-load-balancing` correctly applies ingress controls allowing only internal VPC and Cloud Load Balancer traffic.
Cloud Run uses the `--ingress` flag with values like `all`, `internal`, or `internal-and-cloud-load-balancing` to restrict incoming network requests.
2
Select the appropriate IAM role for managing Cloud Run revisions and traffic splits under least-privilege principles.
The predefined role `roles/run.developer` grants permission to deploy new revisions, update traffic allocations, and view configuration without giving project-wide write access.
Using predefined resource-scoped roles adheres to Google Cloud IAM security best practices, unlike broad primitive roles.

Key Concept

Cloud Run Resource Operational Management (Ingress Controls and Least Privilege IAM)
Rate this question