How to fix Cloud Resource Manager API has not been used in project before or it is disabled in Terraform

TerraformBEGINNERHIGHUpdated Dec 30, 2025· 150 views

The Cloud Resource Manager API disabled error occurs when Terraform tries to manage GCP resources but the cloudresourcemanager.googleapis.com API has not been enabled on the project. This is a chicken-and-egg problem where the API must be manually enabled before Terraform can use it.

Quick fix

Fixes Cloud Resource Manager API has not been used in project before or it is disabled

gcloud services enable cloudresourcemanager.googleapis.com --project=YOUR_PROJECT_ID
  1. Enable via gcloud CLI (recommended)
  2. Enable via Google Cloud Console
  3. Verify API is enabled
  4. Also enable Service Usage API (for service accounts)
terraform — error
gcloud services enable cloudresourcemanager.googleapis.com --project=YOUR_PROJECT_ID
Cloud Resource Manager API has not been used in project before or it is disabled

What this error means

The Cloud Resource Manager API is a foundational GCP API that Terraform requires to manage other APIs and resources in a project. When you try to use Terraform to enable APIs or manage project-level resources, it needs the Cloud Resource Manager API to be available. This error occurs because the API has either never been enabled on the project, or it was explicitly disabled. The tricky part is that Terraform cannot enable this API itself—you need the API to be enabled before Terraform can make any API calls. This creates a bootstrap problem where manual intervention is required for the first enablement.

Typical symptoms

  • Terraform returns "Cloud Resource Manager API has not been used in project" error
  • Error appears immediately when running terraform apply or terraform plan
  • Error message includes a Google Cloud Console URL to enable the API
  • The issue occurs on brand new GCP projects that have no APIs enabled
  • terraform-google-project-factory fails at the beginning of execution
  • Error happens even with a service account that has owner-level permissions
  • Terraform cannot query project information

Common causes

  1. Cloud Resource Manager API was never enabled on the GCP project
  2. Cloud Resource Manager API was previously disabled
  3. Using Terraform with a fresh GCP project without prior setup
  4. Service account created in a project without Cloud Resource Manager API access
  5. Attempting to use terraform-google-project-factory without bootstrap steps
  6. API was removed or disabled by automation or manual intervention

How to fix "Cloud Resource Manager API has not been used in project before or it is disabled"

1Enable via gcloud CLI (recommended)

The fastest solution is to manually enable the API using the gcloud CLI before running Terraform:

bash
gcloud services enable cloudresourcemanager.googleapis.com --project=YOUR_PROJECT_ID

Replace YOUR_PROJECT_ID with your actual GCP project ID. You need the gcloud CLI installed and authenticated.

2Enable via Google Cloud Console

If you prefer the web interface:

1. Go to [Google Cloud Console](https://console.cloud.google.com)
2. Select your project from the dropdown at the top
3. In the left sidebar, click "APIs & Services" > "Library"
4. Search for "Cloud Resource Manager API"
5. Click on the result and click "Enable"
6. Wait 1-2 minutes for the API to activate

You can also use the URL provided in the error message.

3Verify API is enabled

Confirm that the Cloud Resource Manager API is now active:

bash
gcloud services list --enabled --project=YOUR_PROJECT_ID | grep cloudresourcemanager

You should see cloudresourcemanager.googleapis.com in the output.

4Also enable Service Usage API (for service accounts)

If you are using a service account with a JSON key file, you may also need to enable the Service Usage API:

bash
gcloud services enable serviceusage.googleapis.com --project=YOUR_PROJECT_ID

This is required because service accounts use a different API endpoint to enable other APIs.

5Rerun Terraform

After enabling the API, retry your Terraform command:

bash
terraform init
terraform plan
terraform apply

The error should no longer appear, and Terraform can now manage your GCP project.

6For terraform-google-project-factory: use the bootstrap script

If using the terraform-google-project-factory module, it includes a helper script to set up the seed project:

bash
./modules/bootstrap/bin/create_seed_project.sh

This script automatically enables Cloud Resource Manager API on the seed project and configures the service account with the necessary roles.

Advanced notes

For CI/CD pipelines, enable the Cloud Resource Manager API on the GCP project before running Terraform. In GitHub Actions, GitLab CI, or other CI systems, add a step that runs gcloud services enable cloudresourcemanager.googleapis.com before the Terraform steps.

When using service accounts, ensure the service account has the "Service Usage Admin" role (roles/serviceusage.serviceUsageAdmin) or "Owner" role. The Cloud Resource Manager API differs from other APIs—it cannot be enabled by Terraform itself due to this circular dependency, unlike compute.googleapis.com, storage.googleapis.com, etc.

For the terraform-google-project-factory module specifically, the TROUBLESHOOTING.md recommends enabling Cloud Resource Manager on the Seed Project (the project where the factory service account is created), not just the target project. Check that both projects have the API enabled if you are using an organization-level setup.

Frequently asked questions

What does "Cloud Resource Manager API has not been used in project before or it i" mean?
The Cloud Resource Manager API is a foundational GCP API that Terraform requires to manage other APIs and resources in a project. When you try to use Terraform to enable APIs or manage project-level resources, it needs the Cloud Resource Manager API to be available. This error occurs because the API has either never been enabled on the project, or it was explicitly disabled.
How do I fix "Cloud Resource Manager API has not been used in project before or it i"?
The Cloud Resource Manager API disabled error occurs when Terraform tries to manage GCP resources but the cloudresourcemanager.googleapis.com API has not been enabled on the project. This is a chicken-and-egg problem where the API must be manually enabled before Terraform can use it.
What causes "Cloud Resource Manager API has not been used in project before or it i"?
Cloud Resource Manager API was never enabled on the GCP project Cloud Resource Manager API was previously disabled Using Terraform with a fresh GCP project without prior setup
Is the "Cloud Resource Manager API has not been used in project before or it i" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading