in generate/resources/_vm.py [0:0]
def create_instance_from_template(self, ift):
"create instance from template"
ift_name = ift["hostname"]
if ift.get("network"):
ift["network"] = self.tf_ref("network", ift["network"])
if ift.get("subnetwork"):
ift["subnetwork"] = self.tf_ref("subnet", ift["subnetwork"])
if ift.get("subnetwork_project"):
ift["subnetwork_project"] = self.tf_ref("project", ift["subnetwork_project"])
ift["instance_template"] = self.tf_ref("vm_template", ift["instance_template"])
self.created["vm_from_template"][ift_name] = InstanceFromTemplate(
self, f"vmft_{ift_name}", **ift
)