A site reliability engineer is executing a Terraform configuration to provision Google Kubernetes Engine (GKE) clusters in a newly created Google Cloud project named `proj-dev-app-101`. During the `terraform apply` step, the deployment fails with an error indicating that `container.googleapis.com` is disabled. The engineer notes that the Kubernetes Engine API was previously enabled in the central administration project where their local credentials originate. Why did this deployment fail, and what action should be taken to resolve the issue?
- The Kubernetes Engine API must be enabled directly within the target project `proj-dev-app-101` where the resources are being provisioned.Cevap
- BEnabling the API in the administration project is sufficient, but the service account executing Terraform requires the Service Usage Admin role granted at the Google Cloud Organization level.
- CTerraform cannot manage GKE resources unless an exported JSON service account key is embedded directly into the provider configuration to automatically enable missing APIs.
- DThe deployment failed because the `terraform apply` command was executed without specifying the `--enable-apis=true` runtime flag.
Cevap
The Kubernetes Engine API must be enabled directly within the target project `proj-dev-app-101` where the resources are being provisioned.
In Google Cloud, API enablement is scoped individually to each project. Even if deployment tools or identity credentials originate from an administration project, the specific service API (such as `container.googleapis.com`) must be enabled within the destination target project where the infrastructure resources are being provisioned.
Adım Adım Çözüm
Anahtar Kavram
GCP Service API Enablement Project Scope