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.)
- Grant the development team the Service Usage Admin (`roles/serviceusage.serviceUsageAdmin`) role on the target project `dev-analytics-prj`.Cevap
- Execute `gcloud services enable pubsub.googleapis.com --project=dev-analytics-prj` using the Google Cloud CLI.Cevap
- CGrant the development team the Owner (`roles/owner`) primitive role at the Organization level to ensure API management access inherits down to all projects.
- DExecute `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
Anahtar Kavram
Enabling Cloud APIs requires the Service Usage Admin role scoped to the target project and explicit service activation using the gcloud CLI.