Reputation: 756
I'm trying to create a new terraform project as simple as possible that should create an app engine application and deploy a hello world node.js app.
My repository: https://github.com/Leejjon/ts-appengine-terraform
I can run my https://github.com/Leejjon/ts-appengine-terraform/blob/main/terraform/main.tf file with "terraform apply" and it creates all resources just fine, until I add the actual google_app_engine_standard_app_version, which will fail with:
google_app_engine_standard_app_version.app_v2: Creating...
google_app_engine_standard_app_version.app_v2: Still creating... [10s elapsed]
google_app_engine_standard_app_version.app_v2: Still creating... [20s elapsed]
google_app_engine_standard_app_version.app_v2: Still creating... [30s elapsed]
╷
│ Error: Error waiting to create StandardAppVersion: Error waiting for Creating StandardAppVersion: Error code 13, message: An internal error occurred.
│
│ with google_app_engine_standard_app_version.app_v2,
│ on main.tf line 80, in resource "google_app_engine_standard_app_version" "app_v2":
│ 80: resource "google_app_engine_standard_app_version" "app_v2" {
│
╵
Steps to reproduce:
I did verify that I am able to deploy the app using the app.yaml file by running "gcloud app deploy --version=x" inside the app folder: https://github.com/Leejjon/ts-appengine-terraform/blob/main/app/app.yaml
However, it's quite unclear to me what the gcloud app deploy command does under the hood, and how I can replicate that using terraform.
My terraform project is based on:
I also posted this on their app engine issue tracker, but they say they won't help troubleshooting terraform projects: https://issuetracker.google.com/u/3/issues/295518542
Please help me figure out how to troubleshoot this. If it's a permission thing, I was trying to look into the Audit logs to see if somehow terraform had no permissions to to something, but by default nothing is enabled in the Audit logs.
Upvotes: 0
Views: 2046
Reputation: 756
I managed to fixed the error by using a different approach to create a zip file and upload it to the storage bucket, this PR fixed my problem: https://github.com/Leejjon/ts-appengine-terraform/pull/1/files
I kindly copied this approach from this repository: https://github.com/Ipsossiapi/pt_streams
I noticed it fails if I don't upload the node_modules folder. Which is a bit weird as when I use the gcloud app deploy command I don't upload the node_modules folder either (I had the node_modules folder ignored in the .gcloudignore file. Apparently the appengine terraform plugin uses the GCP API instead and it works different.
Upvotes: 0