This submodule allows you to create a google_compute_instance_template
resource, which is used as the basis for the other instance, managed, and
unmanaged instance groups submodules.
See the simple for a usage example.
Name | Description | Type | Default | Required |
---|---|---|---|---|
access_config | Access configurations, i.e. IPs via which the VM instance can be accessed via the Internet. | list(object({ |
[] |
no |
additional_disks | List of maps of additional disks. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#disk_name | list(object({ |
[] |
no |
additional_networks | Additional network interface details for GCE, if any. | list(object({ |
[] |
no |
alias_ip_range | An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks. ip_cidr_range: The IP CIDR range represented by this alias IP range. This IP CIDR range must belong to the specified subnetwork and cannot contain IP addresses reserved by system or used by other network interfaces. At the time of writing only a netmask (e.g. /24) may be supplied, with a CIDR format resulting in an API error. subnetwork_range_name: The subnetwork secondary range name specifying the secondary range from which to allocate the IP CIDR range for this alias IP range. If left unspecified, the primary range of the subnetwork will be used. |
object({ |
null |
no |
auto_delete | Whether or not the boot disk should be auto-deleted | string |
"true" |
no |
can_ip_forward | Enable IP forwarding, for NAT instances for example | string |
"false" |
no |
disk_encryption_key | The id of the encryption key that is stored in Google Cloud KMS to use to encrypt all the disks on this instance | string |
null |
no |
disk_labels | Labels to be assigned to boot disk, provided as a map | map(string) |
{} |
no |
disk_size_gb | Boot disk size in GB | string |
"100" |
no |
disk_type | Boot disk type, can be either pd-ssd, local-ssd, or pd-standard | string |
"pd-standard" |
no |
enable_confidential_vm | Whether to enable the Confidential VM configuration on the instance. Note that the instance image must support Confidential VMs. See https://cloud.google.com/compute/docs/images | bool |
false |
no |
enable_shielded_vm | Whether to enable the Shielded VM configuration on the instance. Note that the instance image must support Shielded VMs. See https://cloud.google.com/compute/docs/images | bool |
false |
no |
gpu | GPU information. Type and count of GPU to attach to the instance template. See https://cloud.google.com/compute/docs/gpus more details | object({ |
null |
no |
labels | Labels, provided as a map | map(string) |
{} |
no |
machine_type | Machine type to create, e.g. n1-standard-1 | string |
"n1-standard-1" |
no |
metadata | Metadata, provided as a map | map(string) |
{} |
no |
min_cpu_platform | Specifies a minimum CPU platform. Applicable values are the friendly names of CPU platforms, such as Intel Haswell or Intel Skylake. See the complete list: https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform | string |
null |
no |
name_prefix | Name prefix for the instance template | string |
"default-instance-template" |
no |
network | The name or self_link of the network to attach this interface to. Use network attribute for Legacy or Auto subnetted networks and subnetwork for custom subnetted networks. | string |
"" |
no |
network_ip | Private IP address to assign to the instance if desired. | string |
"" |
no |
on_host_maintenance | Instance availability Policy | string |
"MIGRATE" |
no |
preemptible | Allow the instance to be preempted | bool |
false |
no |
project_id | The GCP project ID | string |
null |
no |
region | Region where the instance template should be created. | string |
null |
no |
service_account | Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#service_account. | object({ |
n/a | yes |
shielded_instance_config | Not used unless enable_shielded_vm is true. Shielded VM configuration for the instance. | object({ |
{ |
no |
source_image | Source disk image. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. | string |
"" |
no |
source_image_family | Source image family. If neither source_image nor source_image_family is specified, defaults to the latest public CentOS image. | string |
"centos-7" |
no |
source_image_project | Project where the source image comes from. The default project contains CentOS images. | string |
"centos-cloud" |
no |
startup_script | User startup script to run when instances spin up | string |
"" |
no |
subnetwork | The name of the subnetwork to attach this interface to. The subnetwork must exist in the same region this instance will be created in. Either network or subnetwork must be provided. | string |
"" |
no |
subnetwork_project | The ID of the project in which the subnetwork belongs. If it is not provided, the provider project is used. | string |
"" |
no |
tags | Network tags, provided as a list | list(string) |
[] |
no |
Name | Description |
---|---|
name | Name of instance template |
self_link | Self-link of instance template |
tags | Tags that will be associated with instance(s) |