A cloud engineer needs to grant a specific service account named `[email protected]` permission to invoke an existing internal Cloud Run service named `payment-processor`. Following Google Cloud best practices and the principle of least privilege, which `gcloud` command should the engineer execute?
- gcloud run services add-iam-policy-binding payment-processor --member="serviceAccount:[email protected]" --role="roles/run.invoker"Cevap
- Bgcloud run services add-iam-policy-binding payment-processor --member="serviceAccount:[email protected]" --role="roles/editor"
- Cgcloud functions add-iam-policy-binding payment-processor --member="serviceAccount:[email protected]" --role="roles/run.invoker"
- Dgcloud run services update-traffic payment-processor --to-revisions=LATEST=100
Cevap
Execute `gcloud run services add-iam-policy-binding payment-processor --member="serviceAccount:[email protected]" --role="roles/run.invoker"` to grant the specific Cloud Run Invoker role to the service account.
The correct command uses `gcloud run services add-iam-policy-binding` with the target Cloud Run service name (`payment-processor`), specifies the full service account identifier in the `--member` flag, and assigns the predefined least-privilege role `roles/run.invoker`.
Adım Adım Çözüm
Anahtar Kavram
Cloud Run Service Access Management using IAM Policy Bindings