<p>The terraform service account was located in a separate project and the API needed to be enabled for appengine in the account the Terraform service account runs in even though it was creating a resource in an another project.</p>

CC BY-SA 4.0
2021-02-21T11:43:59.200Z
2021-02-21T11:43:59.200Z
Jake Nelson
<p>I'm attempting to enable the AppEngine service via Terraform but I'm getting an error:</p>
<pre><code>Error: Error creating App Engine application: googleapi: Error 403: App Engine Admin API has not been used in project &lt;redacted&gt; before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/appengine.googleapis.com/overview?project=&lt;redacted&gt; then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured
</code></pre>
<p>As far as I know all that should be required to enable the service/API is:</p>
<pre><code>// Enable AppEngine API - required to automagically create datastore
resource &quot;google_project_service&quot; &quot;appengine_api&quot; {
  project = var.project
  service = &quot;appengine.googleapis.com&quot;

  disable_dependent_services = true
}
</code></pre>

CC BY-SA 4.0
2021-02-19T23:39:21.920Z
"If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured" What does it do if you retry a bit later ? (a null_resource just to wait a few minutes before the rest of your plan could be a solution if it works after a retry)
Tensibai
CC BY-SA 4.0
2021-02-21T10:44:53.327Z
@Tensibai, not a timing issue in this case. The API was enabled successfully but all following attempts to create the appengine app fail with that error.
Jake Nelson
CC BY-SA 4.0
2021-02-21T11:35:17.790Z
Yes that's what the message says, the API is created but you may need to way a bit to use it.
Tensibai
<terraform><google-cloud-platform>
How do I enable Google App Engine API with Terraform?
Jake Nelson
# How do I enable Google App Engine API with Terraform?

(Asked by: username_0 on 2021-02-19)

I'm attempting to enable the AppEngine service via Terraform but I'm getting an error:
Error: Error creating App Engine application: googleapi: Error 403: App Engine Admin API has not been used in project  before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/appengine.googleapis.com/overview?project= then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured

As far as I know all that should be required to enable the service/API is:
// Enable AppEngine API - required to automagically create datastore
resource "google_project_service" "appengine_api" {
  project = var.project
  service = "appengine.googleapis.com"

  disable_dependent_services = true
}

**Tags:** terraform, google-cloud-platform

> **Comments:**
> **username_1**: "If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry., accessNotConfigured" What does it do if you retry a bit later ? (a null_resource just to wait a few minutes before the rest of your plan could be a solution if it works after a retry)  
> **username_0**: @username_1, not a timing issue in this case. The API was enabled successfully but all following attempts to create the appengine app fail with that error.  
> **username_1**: Yes that's what the message says, the API is created but you may need to way a bit to use it.  

---

## 1 answers

### Answer by username_0 on 2021-02-21. Score: 1

The terraform service account was located in a separate project and the API needed to be enabled for appengine in the account the Terraform service account runs in even though it was creating a resource in an another project.


---

