#####Unable to deploy a standard app engine and giving me a weird error always#####

243 views
Skip to first unread message

mbsas...@gmail.com

unread,
Dec 22, 2020, 7:27:22 AM12/22/20
to Terraform
Hi Team,

We are automating the app engine deployment  and as part of it i picked the first component that is Node JS part and deploying it
TF version - 0.13.0
Steps I did --
1. Create a gcs bucket and upload the package as zip format
2. Create a standard app engine and deploy the package from the URL of bucket

I really dont understand why it says field is required and I did check on official documentation here and dont see any mandate variable like that


Please help me as I'm fed up of this error since two days . Any ideas are welcome need not to be an solution

Error ---
creating StandardAppVersion: googleapi: Error 400: version.id: This field is required.
2020-12-22T12:12:19.2071569Z Details:
2020-12-22T12:12:19.2071971Z [
2020-12-22T12:12:19.2072458Z   {
2020-12-22T12:12:19.2072672Z     "@type": "type.googleapis.com/google.rpc.BadRequest",
2020-12-22T12:12:19.2073264Z     "fieldViolations": [
2020-12-22T12:12:19.2073619Z       {
2020-12-22T12:12:19.2073800Z         "description": "This field is required.",
2020-12-22T12:12:19.2074030Z         "field": "version.id"
2020-12-22T12:12:19.2074181Z       }
2020-12-22T12:12:19.2074310Z     ]
2020-12-22T12:12:19.2074420Z   }


Main.tf file


provider "google" {
  project     = var.project_id
  region      = var.location
}
/*
provider "google" {
# credentials = file("cobaltcreds.json")
 project     = "cobalt-matrix-299316"
 region      = "us-west1"
}
*/

terraform {
  backend "gcs" {
  }
}
 

resource "google_project_service" "gcp_resource_manager_api" {
  project = var.project_id
}

resource "time_sleep" "gcp_wait_crm_api_enabling" {
  depends_on = [
    google_project_service.gcp_resource_manager_api
  ]

  create_duration = "30s"
}

module "project-services" {
  source  = "terraform-google-modules/project-factory/google//modules/project_services"
  version = "4.0.0"

  project_id    = var.project_id

  activate_apis = [
  ]
}

module "gcs_buckets" {
  source  = "terraform-google-modules/cloud-storage/google"
  version = "~> 1.7"
  
  project_id                = var.project_id
  names                     = var.names
  prefix                    = var.project_id
  set_admin_roles           = true
  location                  = var.location
  storage_class             = var.storage_class
  admins                    = var.admins
  versioning = {}
  bucket_admins = {
     }
}

 data "archive_file" "app-engine-source-zip" {
 type        = "zip"
# source_dir  = "./app-engine-reactcode/drop-qas"
 source_dir = var.drop_path
 output_path = "./drop.zip"
}

resource "google_storage_bucket_object" "app-engine-source-zip-obj" {
 depends_on = [module.gcs_buckets]

 name   = "app-engine-reactcode.${data.archive_file.app-engine-source-zip.output_md5}.zip"
 bucket = join("-", [var.project_id, lower(var.location), "src"])
 source = data.archive_file.app-engine-source-zip.output_path
}

resource "google_app_engine_standard_app_version" "app-version" {
  runtime = "nodejs10"
 # service = "default"
  service = "service-terraform" 
  
  
  deployment  {
    zip {
    }

  }
  entrypoint {
    shell = "hostname"
  }
}
 

Reply all
Reply to author
Forward
0 new messages