Creating a basic template
A template is a file you create, written in either Jinja or Python
Create a file with extension .jinja.

Paste the below code
resources: - name: vm-template type: compute.v1.instance properties: zone: us-central1-a machineType: zones/us-central1-a/machineTypes/n1-standard-1 disks: - deviceName: boot type: PERSISTENT boot: true autoDelete: true initializeParams: sourceImage: projects/debian-cloud/global/images/family/debian-9 networkInterfaces: - network: global/networks/default
Press ctrl+x then y then enter. The file will be saved.

Type $ pwd. It will show the path of file located.

Create a configuration file with extension .yaml
$ nano vm-config.yaml

Paste the below code
imports: - path: path/my_vm_template.jinja resources: - name: my-first-virtual-machine type: path/to/my_vm_template.jinja
Press ctrl+x then y then enter. The file will be saved.

Then you can deploy the configuration file that contains the templates.
Deploying templates directly with the command-line tool
$ gcloud deployment-manager deployments create a-single-vm --template vm_template.jinja
