google_compute_instance_from_machine_image

Manages a VM instance resource within GCE. For more information see the official documentation and API.

This resource is specifically to create a compute instance from a given source_machine_image. To create an instance without a machine image, use the google_compute_instance resource.

Example Usage

resource "google_compute_instance_from_machine_image" "tpl" {
  provider = google-beta
  name     = "instance-from-machine-image"
  zone     = "us-central1-a"

  source_machine_image = "projects/PROJECT-ID/global/machineImages/NAME"

  // Override fields from machine image
  can_ip_forward = false
  labels = {
    my_key = "my_value"
  }
}

Argument Reference

The following arguments are supported:


In addition to these, most* arguments from google_compute_instance are supported as a way to override the properties in the machine image. All exported attributes from google_compute_instance are likewise exported here.

Attributes Reference

All exported attributes from google_compute_instance are exported here. See https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance#attributes-reference for details.

Timeouts

This resource provides the following Timeouts configuration options: configuration options: