--- # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # # ---------------------------------------------------------------------------- # # This file is automatically generated by Magic Modules and manual # changes will be clobbered when the file is regenerated. # # Please read more about how to change this file in # .github/CONTRIBUTING.md. # # ---------------------------------------------------------------------------- layout: "google" page_title: "Google: google_compute_node_template" sidebar_current: "docs-google-compute-node-template" description: |- Represents a NodeTemplate resource. --- # google\_compute\_node\_template Represents a NodeTemplate resource. Node templates specify properties for creating sole-tenant nodes, such as node type, vCPU and memory requirments, node affinity labels, and region. To get more information about NodeTemplate, see: * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/nodeTemplates) * How-to Guides * [Sole-Tenant Nodes](https://cloud.google.com/compute/docs/nodes/)
Open in Cloud Shell
## Example Usage - Node Template Basic ```hcl data "google_compute_node_types" "central1a" { zone = "us-central1-a" } resource "google_compute_node_template" "template" { name = "soletenant-tmpl" region = "us-central1" node_affinity_labels = { foo = "baz" } node_type = "${data.google_compute_node_types.central1a.names[0]}" } ``` ## Argument Reference The following arguments are supported: - - - * `description` - (Optional) An optional textual description of the resource. * `name` - (Optional) Name of the resource. * `node_affinity_labels` - (Optional) Labels to use for node affinity, which will be used in instance scheduling. * `node_type` - (Optional) Node type to use for nodes group that are created from this template. Only one of nodeTypeFlexibility and nodeType can be specified. * `node_type_flexibility` - (Optional) Flexible properties for the desired node type. Node groups that use this node template will create nodes of a type that matches these properties. Only one of nodeTypeFlexibility and nodeType can be specified. Structure is documented below. * `region` - (Optional) Region where nodes using the node template will be created. If it is not provided, the provider region is used. * `project` - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used. The `node_type_flexibility` block supports: * `cpus` - (Optional) Number of virtual CPUs to use. * `memory` - (Optional) Physical memory available to the node, defined in MB. * `local_ssd` - Use local SSD ## Attributes Reference In addition to the arguments listed above, the following computed attributes are exported: * `creation_timestamp` - Creation timestamp in RFC3339 text format. * `self_link` - The URI of the created resource. ## Timeouts This resource provides the following [Timeouts](/docs/configuration/resources.html#timeouts) configuration options: - `create` - Default is 4 minutes. - `delete` - Default is 4 minutes. ## Import NodeTemplate can be imported using any of these accepted formats: ``` $ terraform import google_compute_node_template.default projects/{{project}}/regions/{{region}}/nodeTemplates/{{name}} $ terraform import google_compute_node_template.default {{project}}/{{region}}/{{name}} $ terraform import google_compute_node_template.default {{name}} ``` -> If you're importing a resource with beta features, make sure to include `-provider=google-beta` as an argument so that Terraform uses the correct provider to import your resource.