Soru

Zorluk: OrtaDeploying Infrastructure using Deployment Manager or Terraform

An infrastructure team is preparing to deploy a set of virtual machine instances into a target Google Cloud project named `infra-prod-882` using Google Cloud Deployment Manager. When executing the `gcloud deployment-manager deployments create` command, the deployment fails with an error stating that `compute.googleapis.com` is disabled. Which action must be taken to successfully execute the deployment?

  1. Enable the Compute Engine API directly within the target project `infra-prod-882` before launching the deployment.Cevap
  2. B
    Enable the Compute Engine API in the billing project hosting the linked Cloud Billing Account.
  3. C
    Enable the Compute Engine API at the organization root level to allow permission inheritance down the resource hierarchy.
  4. D
    Apply an Organization Policy at the folder level to automatically activate service APIs for child projects.

Cevap

Enable the Compute Engine API directly within the target project `infra-prod-882` before launching the deployment.
In Google Cloud, infrastructure management tools such as Deployment Manager and Terraform interact with Google Cloud APIs on behalf of the project. Every GCP project must have the relevant service APIs (such as `compute.googleapis.com` for VMs and networks) explicitly enabled within that specific project before resources can be created.

Adım Adım Çözüm

1
Analyze the error message from Deployment Manager
The error indicates `compute.googleapis.com` is disabled in project `infra-prod-882`.
Deployment Manager acts as an orchestrator that calls underlying GCP service APIs; if the API is disabled in the target project, resource creation fails.
2
Determine the scope of API enablement in Google Cloud
Recognize that service API enablement is project-specific.
APIs must be explicitly enabled in the project where the resources will be instantiated.
3
Enable the required API and retry deployment
Execute `gcloud services enable compute.googleapis.com --project=infra-prod-882` and then re-run the deployment.
Enabling the API in `infra-prod-882` grants Deployment Manager permission to provision Compute Engine resources in that project.

Anahtar Kavram

Project-scoped API enablement for Infrastructure as Code deployments
Tahmini Süre:1m 30s
Bu soruyu puanla