Soru

Zorluk: OrtaManaging Cloud Run Resources

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?

  1. gcloud run services update invoice-service --vpc-connector=vpc-conn --vpc-egress=all-traffic --region=us-central1Cevap
  2. B
    gcloud run services update-traffic invoice-service --vpc-connector=vpc-conn --region=us-central1
  3. C
    gcloud functions deploy invoice-service --vpc-connector=vpc-conn --region=us-central1
  4. D
    gcloud projects add-iam-policy-binding project-id --member=serviceAccount:[email protected] --role=roles/owner

Cevap

Execute the command `gcloud run services update invoice-service --vpc-connector=vpc-conn --vpc-egress=all-traffic --region=us-central1` to attach the Serverless VPC Access connector and route all outbound traffic through it.
To route all outbound traffic from an existing Cloud Run service through a Serverless VPC Access connector, you update the service configuration using `gcloud run services update` with `--vpc-connector` to set the connector name and `--vpc-egress=all-traffic` to specify that all egress traffic must pass through the VPC.

Adım Adım Çözüm

1
Identify the resource type and management action required.
The target is an existing Cloud Run service, so `gcloud run services update` is the correct base command.
Modifying runtime infrastructure parameters on Cloud Run requires updating service settings rather than deploying functions or modifying traffic splits.
2
Specify the VPC connector configuration flags.
Use `--vpc-connector=vpc-conn` and `--vpc-egress=all-traffic` along with the `--region=us-central1` flag.
Setting `--vpc-egress=all-traffic` ensures all outbound connections from the Cloud Run instances pass through the specified Serverless VPC Access connector.

Anahtar Kavram

Cloud Run Outbound Networking and Serverless VPC Access Connector Management
Bu soruyu puanla