Open
Description
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
- Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
- If you are interested in working on this issue or have submitted a pull request, please leave a comment.
- If an issue is assigned to a user, that user is claiming responsibility for the issue.
- Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.
Terraform Version & Provider Version(s)
Terraform v1.7.0
on linux_amd64
- provider registry.terraform.io/hashicorp/google v6.27.0
Affected Resource(s)
google_app_engine_standard_app_version
Terraform Configuration
resource "google_app_engine_standard_app_version" "default" {
project = <project 1 name>
service = "service-name"
version_id = "v1"
runtime = "static" # Use the 'static' runtime
entrypoint {
shell = "echo 'Serving static content'" # Required, but doesn't do anything for static runtime.
}
deployment {
zip {
source_url = "gs://bucket/file.zip"
}
}
handlers {
url_regex = ".*"
static_files {
application_readable = true
upload_path_regex = ".*" # Serve all files from the zip
}
}
service_account = google_service_account.gae_sa.email
}
Debug Output
Error: Error creating StandardAppVersion: googleapi: Error 403: App Engine Admin API has not been used in project <project 2 ID> before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/appengine.googleapis.com/overview?project=<project 2 ID> then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
Expected Behavior
google_app_engine_standard_app_version is created successfully in project 1.
Actual Behavior
Error is thrown indicating that appengine.googleapis.com must be enabled in project 2
Steps to reproduce
No response
Important Factoids
We use guardian to apply our TF changes. When we don't set the project
field in any TF resource, it uses the GCP project of guardian by default (in the error logs above referred as <project 2>).
Although we are setting project
to <project 1> in google_app_engine_standard_app_version
, it seems to be ignored.
References
Looking at the implementation code, it seems that even if you provide a project
, it might get overriden if a billing_project
is found: