Error 403: API has not been used in project (Terraform) Terraform Origin: Platform & cloud OSI layer 7 · Application Last updated 5 Nov 2026

Terraform: Error: Error creating Network: googleapi: Error 403: Compute Engine API has not been used in project 123 before or it is disabled

Terraform called a Google API that isn't enabled in the project.

Exact message you may see Error: Error creating Network: googleapi: Error 403: Compute Engine API has not been used in project 123 before or it is disabledgoogleapi: Error 403: Compute Engine API has not been used in projectError: Error waiting for Enabling Service: Error code 7SERVICE_DISABLED terraform googlegoogleapi: Error 403 accessNotConfigured
Seen on: Terraform Google Cloud

Meaning

Enable it (gcloud services enable compute.googleapis.com) or manage it with google_project_service. Use depends_on = [google_project_service.compute] so resources wait for enablement; allow time for propagation (retry). Billing must be linked for most APIs.

Common causes

  • API not enabled
  • Enablement not yet propagated
  • Wrong project (quota project)
  • Billing not linked
  • Service Usage API disabled itself

⚡ Quick fix

  1. gcloud services enable compute.googleapis.com --project PROJECT
  2. Manage with google_project_service + depends_on
  3. Retry apply after a minute

Detailed fix by platform

Terraform

  1. resource "google_project_service" "compute" { service = "compute.googleapis.com" disable_on_destroy = false }

How to diagnose

  1. API — Enabled?
  2. Project — Right?
  3. Billing — Linked?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

403: does not have storage.objects.get access — Cloud Storage: 403 Forbidden — user@example.com does not have storage.objects.get access to the Google Cloud Storage object (Google Cloud / Firebase)403: does not have st…409: The resource already exists — Compute Engine: ERROR: (gcloud.compute.instances.create) Could not fetch resource: The resource 'projects/p/zones/z/instances/vm-1' already exists (Google Cloud / Firebase)409: The resource alr…429 RESOURCE_EXHAUSTED: Quota exceeded for quota metric — Google API: 429 RESOURCE_EXHAUSTED — Quota exceeded for quota metric 'Read requests' and limit 'Read requests per minute per user' (Google Cloud / Firebase)429 RESOURCE_EXHAUSTE…502 Bad Gateway: failed_to_connect_to_backend — Google Cloud Load Balancing: 502 Bad Gateway — jsonPayload.statusDetails: failed_to_connect_to_backend / backend_connection_closed_before_data_sent_to_client (Google Cloud / Firebase)502 Bad Gateway: fail…API has not been used in project before or it is disabled — Google Cloud: 403 SERVICE_DISABLED — Cloud Resource Manager API has not been used in project 123456 before or it is disabled. Enable it by visiting (Google Cloud / Firebase)API has not been used…Artifact Registry: Permission artifactregistry.repositories.uploadArtifacts denied — Docker push: denied: Permission "artifactregistry.repositories.uploadArtifacts" denied on resource "projects/p/locations/l/repositories/r" (Google Cloud / Firebase)Artifact Registry: Pe…BigQuery: Access Denied: Project: User does not have bigquery.jobs.create permission — BigQuery: Access Denied: Project my-project: User does not have bigquery.jobs.create permission in project my-project (Google Cloud / Firebase)BigQuery: Access Deni…BigQuery: Not found: Dataset was not found in location — BigQuery: Not found: Dataset my-project:analytics was not found in location EU (Google Cloud / Firebase)BigQuery: Not found: …Error 403…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.