How to fix Error creating service account googleapi Error 403 Identity and Access Management (IAM) API has not been used in project before or it is disabled



In this article we are going to see - How to fix the issue - Error creating service account googleapi Error 403 Identity and Access Management (IAM) API has not been used in project 4686446XXXX before or it is disabled

(In case you need help with setting GCP Compute instance here is the guide)

Issue

I also faced this issue when I was trying to create my first GCP Compute Instance using terraform.

Here are my assumption on the steps you might have already done -

  1. You have already installed Terraform on your system (Click here for installation guide)
  2. You are able to run terraform init command successfully
  3. You are able to run terraform plan also.
  4. But when you ran terraform apply you saw the error
1google_service_account.default: Creating...
2google_compute_instance.default: Creating...
3
4Error: Error creating service account: googleapi: Error 403: Identity and Access Management (IAM) API has not been 
5used in project 46864460xxxx before or it is disabled. Enable it by visiting https://console.developers.google.
6com/apis/api/iam.googleapis.com/overview?project=46864460xxxx then retry. If you enabled this API recently, wait a 
7few minutes for the action to propagate to our systems and retry., accessNotConfigured




How to fix the issue

To fix this issue you need to ENABLE to enable the project.

How to enable the project

From the error log you need to copy the URL .i.e. -

1https://console.developers.google.com/apis/api/iam.googleapis.com/overview?project=46864460xxxx 

Open this URL into the browser -

Error creating service account googleapi Error 403 Identity and Access Management (IAM) APIhas not been used in project before or it is disabled

Once you enable the project and re-run terraform apply then your error should be gone.




Read More - Terragrunt -

  1. How to use Terragrunt?

Posts in this Series