Skip to main content

GCP Compute Instance Template

A Compute Engine instance template is a reusable blueprint that captures almost all of the configuration needed to launch a Virtual Machine (VM) instance in Google Cloud: machine type, boot image, attached disks, network interfaces, metadata, service accounts, shielded-VM options and more. Templates allow you to create individual VM instances consistently or serve as the basis for managed instance groups that can scale automatically.
Official documentation: https://cloud.google.com/compute/docs/instance-templates

Terrafrom Mappings:

  • google_compute_instance_template.name

Supported Methodsโ€‹

  • GET: Get a gcp-compute-instance-template by its "name"
  • LIST: List all gcp-compute-instance-template
  • SEARCH

gcp-cloud-kms-crypto-keyโ€‹

If customer-managed encryption keys (CMEK) are specified in the template, they reference a Cloud KMS crypto-key that will be used to encrypt the boot or data disks of any VM created from the template.

gcp-compute-diskโ€‹

The template can define additional persistent disks to be auto-created and attached, or it can attach existing disks in read-only or read-write mode.

gcp-compute-imageโ€‹

The boot disk section of the template points to a Compute Engine image that is cloned each time a new VM is launched.

gcp-compute-instanceโ€‹

When a user or an autoscaler instantiates the template, it materialises as one or more Compute Engine instances that inherit every property defined in the template.

gcp-compute-machine-typeโ€‹

The template explicitly sets the machine type (vCPU/RAM shape) that each resulting VM will use.

gcp-compute-networkโ€‹

Every network interface defined in the template must belong to a VPC network, so the template contains links to the relevant network resources.

gcp-compute-node-groupโ€‹

If the template targets sole-tenant nodes, it can specify a node group affinity so that all created VMs land on a particular node group.

gcp-compute-reservationโ€‹

Templates may be configured to consume capacity from an existing reservation, ensuring launched VMs fit within reserved resources.

gcp-compute-security-policyโ€‹

Tags or service-account settings in the template can cause the resulting instances to match Cloud Armor security policies applied at the project or network level.

gcp-compute-snapshotโ€‹

Instead of an image, the template can build new disks from a snapshot, linking the template to that snapshot resource.

gcp-compute-subnetworkโ€‹

For networks that are in auto or custom subnet mode, the template points to the exact subnetwork each NIC should join.

gcp-iam-service-accountโ€‹

The template includes a service account and its OAuth scopes; the created VMs will assume that service accountโ€™s identity and permissions.