github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/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 ```js 19 resource "google_compute_image" "bootable-image" { 20 name = "my-custom-image" 21 raw_disk { 22 source = "https://storage.googleapis.com/my-bucket/my-disk-image-tarball.tar.gz" 23 } 24 } 25 26 resource "google_compute_instance" "vm" { 27 name = "vm-from-custom-image" 28 machine_type = "n1-standard-1" 29 zone = "us-east1-c" 30 31 disk { 32 image = "${google_compute_image.bootable-image.self_link}" 33 } 34 35 network_interface { 36 network = "default" 37 } 38 } 39 ``` 40 41 ## Argument Reference 42 43 The following arguments are supported: 44 45 * `name` - (Required) A unique name for the resource, required by GCE. 46 Changing this forces a new resource to be created. 47 48 * `raw_disk` - (Required) The raw disk that will be used as the source of 49 the image. Changing this forces a new resource to be created. 50 Structure is documented below. 51 52 The `raw_disk` block supports: 53 54 * `source` - (Required) The full Google Cloud Storage URL where the disk 55 image is stored. 56 57 * `sha1` - (Optional) SHA1 checksum of the source tarball that will be used 58 to verify the source before creating the image. 59 60 * `container_type` - (Optional) The format used to encode and transmit the 61 block device. TAR is the only supported type and is the default. 62 63 - - - 64 65 * `project` - (Optional) The project in which the resource belongs. If it 66 is not provided, the provider project is used. 67 68 * `description` - (Optional) The description of the image to be created 69 70 * `family` - (Optional) The name of the image family to which this image belongs. 71 72 ## Attributes Reference 73 74 In addition to the arguments listed above, the following computed attributes are 75 exported: 76 77 * `self_link` - The URI of the created resource.