Hello Everyone
I am trying out GCP for the first time. I have an instance of Jenkins set up on my laptop running Windows 10. I am trying to create a Jenkins pipeline that does a Java build and deploys it to GCP. When I try to run the build, I get the following error:
POST https://compute.googleapis.com/compute/v1/projects/elite-impact-378112/zones/europe-west2-a/instances
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid value for field 'resource.networkInterfaces[0].subnetwork': ''. Subnetwork should not be empty.",
"reason" : "invalid"
} ],
"message" : "Invalid value for field 'resource.networkInterfaces[0].subnetwork': ''. Subnetwork should not be empty."
}
Looking at the documentation, I discovered that the url for the subnetwork resource ought to have the form
https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork
it seems mine is missing the instance/subnetwork at the end. I think this is related to the fact that when I was configuring the Google Compute Engine in my local instance of Jenkins, The dropdown menu labelled “Machine Configuration Template to use” was always empty. I tried every allowable combination of the Region and Zone dropdown menus but the Template menu always came up blank. Please I would be extremely grateful on any pointers as to how to solve this problem.