github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/google/r/compute_image.html.markdown (about) 1 --- 2 layout: "google" 3 page_title: "Google: google_compute_image" 4 sidebar_current: "docs-google-compute-image" 5 description: |- 6 Creates a bootable VM image for Google Compute Engine from an existing tarball. 7 --- 8 9 # google\_compute\_image 10 11 Creates a bootable VM image resource for Google Compute Engine from an existing 12 tarball. For more information see [the official documentation](https://cloud.google.com/compute/docs/images) and 13 [API](https://cloud.google.com/compute/docs/reference/latest/images). 14 15 16 ## Example Usage 17 18 ```hcl 19 resource "google_compute_image" "bootable-image" { 20 name = "my-custom-image" 21 22 raw_disk { 23 source = "https://storage.googleapis.com/my-bucket/my-disk-image-tarball.tar.gz" 24 } 25 } 26 27 resource "google_compute_instance" "vm" { 28 name = "vm-from-custom-image" 29 machine_type = "n1-standard-1" 30 zone = "us-east1-c" 31 32 disk { 33 image = "${google_compute_image.bootable-image.self_link}" 34 } 35 36 network_interface { 37 network = "default" 38 } 39 } 40 ``` 41 42 ## Argument Reference 43 44 The following arguments are supported: (Note that one of either source_disk or 45 raw_disk is required) 46 47 * `name` - (Required) A unique name for the resource, required by GCE. 48 Changing this forces a new resource to be created. 49 50 * `source_disk` - The URL of a disk that will be used as the source of the 51 image. Changing this forces a new resource to be created. 52 53 * `raw_disk` - The raw disk that will be used as the source of the image. 54 Changing this forces a new resource to be created. Structure is documented 55 below. 56 57 * `create_timeout` - Configurable timeout in minutes for creating images. Default is 4 minutes. 58 Changing this forces a new resource to be created. 59 60 The `raw_disk` block supports: 61 62 * `source` - (Required) The full Google Cloud Storage URL where the disk 63 image is stored. 64 65 * `sha1` - (Optional) SHA1 checksum of the source tarball that will be used 66 to verify the source before creating the image. 67 68 * `container_type` - (Optional) The format used to encode and transmit the 69 block device. TAR is the only supported type and is the default. 70 71 - - - 72 73 * `project` - (Optional) The project in which the resource belongs. If it 74 is not provided, the provider project is used. 75 76 * `description` - (Optional) The description of the image to be created 77 78 * `family` - (Optional) The name of the image family to which this image belongs. 79 80 ## Attributes Reference 81 82 In addition to the arguments listed above, the following computed attributes are 83 exported: 84 85 * `self_link` - The URI of the created resource.