Soru

Zorluk: OrtaEnabling and Managing Cloud Service APIs

A software team is onboarding a new application project named `dev-analytics-prj` that requires access to Google Cloud Pub/Sub. To maintain strict security compliance, the team must be granted minimal necessary permissions to enable required APIs on this project, and the API must be enabled via the Cloud SDK CLI. Which of the following actions are necessary to successfully enable the Cloud Service API under these requirements? (Select TWO.)

  1. Grant the development team the Service Usage Admin (`roles/serviceusage.serviceUsageAdmin`) role on the target project `dev-analytics-prj`.Cevap
  2. Execute `gcloud services enable pubsub.googleapis.com --project=dev-analytics-prj` using the Google Cloud CLI.Cevap
  3. C
    Grant the development team the Owner (`roles/owner`) primitive role at the Organization level to ensure API management access inherits down to all projects.
  4. D
    Execute `gcloud services enable pubsub.googleapis.com` from a central host project without specifying the `--project` flag, allowing automatic API propagation across the project hierarchy.

Cevap

To enable the Pub/Sub API on project `dev-analytics-prj` following least privilege and CLI requirements, grant the Service Usage Admin (`roles/serviceusage.serviceUsageAdmin`) role on project `dev-analytics-prj` and execute `gcloud services enable pubsub.googleapis.com --project=dev-analytics-prj`.
Enabling a Google Cloud Service API requires two key requirements: granting the principle-of-least-privilege IAM role (`roles/serviceusage.serviceUsageAdmin`) on the destination project, and targeting that project explicitly when running `gcloud services enable <service_name> --project=<project_id>`.

Adım Adım Çözüm

1
Identify the minimum required IAM role for enabling APIs on a specific project.
The Service Usage Admin (`roles/serviceusage.serviceUsageAdmin`) role provides permissions (`serviceusage.services.enable`) to manage APIs without granting unnecessary administrative permissions.
Security compliance requires using predefined roles according to the principle of least privilege instead of broad primitive roles like Owner.
2
Determine the proper gcloud CLI command and parameters to enable the targeted service.
Use `gcloud services enable pubsub.googleapis.com` with the `--project=dev-analytics-prj` flag.
Google Cloud service APIs must be explicitly enabled on the specific project consuming the service.

Anahtar Kavram

Enabling Cloud APIs requires the Service Usage Admin role scoped to the target project and explicit service activation using the gcloud CLI.
Bu soruyu puanla