--- # ---------------------------------------------------------------------------- # # *** 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_group" sidebar_current: "docs-google-compute-node-group" description: |- Represents a NodeGroup resource to manage a group of sole-tenant nodes. --- # google\_compute\_node\_group Represents a NodeGroup resource to manage a group of sole-tenant nodes. To get more information about NodeGroup, see: * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups) * How-to Guides * [Sole-Tenant Nodes](https://cloud.google.com/compute/docs/nodes/) ~> **Warning:** Due to limitations of the API, Terraform cannot update the number of nodes in a node group and changes to node group size either through Terraform config or through external changes will cause Terraform to delete and recreate the node group.
Open in Cloud Shell
## Example Usage - Node Group Basic ```hcl data "google_compute_node_types" "central1a" { zone = "us-central1-a" } resource "google_compute_node_template" "soletenant-tmpl" { name = "soletenant-tmpl" region = "us-central1" node_type = "${data.google_compute_node_types.central1a.names[0]}" } resource "google_compute_node_group" "nodes" { name = "soletenant-group" zone = "us-central1-a" description = "example google_compute_node_group for Terraform Google Provider" size = 1 node_template = "${google_compute_node_template.soletenant-tmpl.self_link}" } ``` ## Argument Reference The following arguments are supported: * `node_template` - (Required) The URL of the node template to which this node group belongs. * `size` - (Required) The total number of nodes in the node group. - - - * `description` - (Optional) An optional textual description of the resource. * `name` - (Optional) Name of the resource. * `zone` - (Optional) Zone where this node group is located * `project` - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used. ## 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. - `update` - Default is 4 minutes. - `delete` - Default is 4 minutes. ## Import NodeGroup can be imported using any of these accepted formats: ``` $ terraform import google_compute_node_group.default projects/{{project}}/zones/{{zone}}/nodeGroups/{{name}} $ terraform import google_compute_node_group.default {{project}}/{{zone}}/{{name}} $ terraform import google_compute_node_group.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.