github.com/pbthorste/terraform@v0.8.6-0.20170127005045-deb56bd93da2/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: (Note that one of either source_disk or
    44    raw_disk is required)
    45  
    46  * `name` - (Required) A unique name for the resource, required by GCE.
    47      Changing this forces a new resource to be created.
    48  
    49  * `source_disk` - The URL of a disk that will be used as the source of the
    50      image. Changing this forces a new resource to be created.
    51  
    52  * `raw_disk` - The raw disk that will be used as the source of the image.
    53      Changing this forces a new resource to be created. Structure is documented
    54      below.
    55  
    56  * `create_timeout` - Configurable timeout in minutes for creating images. Default is 4 minutes.
    57      Changing this forces a new resource to be created.
    58  
    59  The `raw_disk` block supports:
    60  
    61  * `source` - (Required) The full Google Cloud Storage URL where the disk
    62      image is stored.
    63  
    64  * `sha1` - (Optional) SHA1 checksum of the source tarball that will be used
    65      to verify the source before creating the image.
    66  
    67  * `container_type` - (Optional) The format used to encode and transmit the
    68      block device. TAR is the only supported type and is the default.
    69  
    70  - - -
    71  
    72  * `project` - (Optional) The project in which the resource belongs. If it
    73      is not provided, the provider project is used.
    74  
    75  * `description` - (Optional) The description of the image to be created
    76  
    77  * `family` - (Optional) The name of the image family to which this image belongs.
    78  
    79  ## Attributes Reference
    80  
    81  In addition to the arguments listed above, the following computed attributes are
    82  exported:
    83  
    84  * `self_link` - The URI of the created resource.