async function createRegionalTemplate() {
    // Define the boot disk for the instance template
    const disk = new compute.AttachedDisk({
      initializeParams: new compute.AttachedDiskInitializeParams({
        sourceImage:
          'projects/debian-cloud/global/images/debian-12-bookworm-v20240815',
        diskSizeGb: '100',
        diskType: 'pd-balanced',
      }),
      autoDelete: true,
      boot: true,
      type: 'PERSISTENT',
    });

    // Define the network interface for the instance template
    const network = new compute.NetworkInterface({
      network: `projects/${projectId}/global/networks/default`,
    });

    // Define instance template
    const instanceTemplate = new compute.InstanceTemplate({
      name: templateName,
      properties: {
        disks: [disk],
        region,
        machineType: 'e2-medium',
        // The template connects the instance to the `default` network,
        // without specifying a subnetwork.
        networkInterfaces: [network],
      },
    });

    const [response] = await regionInstanceTemplatesClient.insert({
      project: projectId,
      region,
      instanceTemplateResource: instanceTemplate,
    });

    let operation = response.latestResponse;

    // Wait for the create operation to complete.
    while (operation.status !== 'DONE') {
      [operation] = await regionOperationsClient.wait({
        operation: operation.name,
        project: projectId,
        region,
      });
    }

    console.log(`Template: ${templateName} created.`);
  }
TODO(developer): Update/uncomment these variables before running the sample.