Soru

Zorluk: OrtaDeploying Infrastructure using Deployment Manager or Terraform

A DevOps engineer is using Terraform to automate infrastructure deployment into a dedicated target project named `app-prod-1029`. The service account executing the Terraform pipeline resides in a shared management project `mgmt-hub-8821`. During execution, the pipeline fails with an error indicating that the Compute Engine API (`compute.googleapis.com`) is not enabled for the operation. Which action should the engineer perform to successfully deploy the resources?

  1. Enable the Compute Engine API in the target project `app-prod-1029` where the infrastructure resources are being provisioned.Cevap
  2. B
    Enable the Compute Engine API in the shared management project `mgmt-hub-8821` where the execution service account is hosted.
  3. C
    Enable the Compute Engine API at the organization node level so that API activation inherits automatically down to all child projects.
  4. D
    Grant the Service Account User role to the execution identity in the `mgmt-hub-8821` project to bypass project API requirements.

Cevap

Enable the Compute Engine API in the target project `app-prod-1029` where the infrastructure resources are being provisioned.
In Google Cloud, infrastructure service APIs (such as `compute.googleapis.com`) must be enabled specifically within the target project where the resources are created. Even if a Terraform execution service account resides in a separate central management project, resource calls target the destination project, requiring the API to be enabled there.

Adım Adım Çözüm

1
Identify the project where resources are being provisioned
The target project is `app-prod-1029`.
Google Cloud service APIs must be enabled within the specific project hosting the target resources.
2
Activate the required Google Cloud API
Enable `compute.googleapis.com` in `app-prod-1029`.
Without activating the service API in the target project, API calls sent by Terraform to create resources will fail.

Anahtar Kavram

API enablement in Google Cloud target projects for IaC deployments
Bu soruyu puanla