I have tried to create a vm instance from instance template in Google Cloud by using API from Postman.
API Request:
POST https://compute.googleapis.com/compute/v1/projects/ PROJECT_ID/zones/ZONE/instances?sourceInstanceTemplate=INSTANCE_TEMPLATE_NAME
with body
{
"name": "vm-from-instance-temp",
}
Ref: Create a VM from an instance template | Compute Engine Documentation | Google Cloud
But I got this error messages.
Hello antza,
Reading this post from Github, they explained what might be causing the issue is to should send the id instead of the name for resourcePolicies.
Noticed the data format of resourcePolicies
, it is a shortname returned from api but when creating an instance, it requires the format like projects/%s/regions/%s/resourcePolicies/%s
. The provider rely on whatever returned from api of the template to create an instance.