github.com/ves/terraform@v0.8.0-beta2/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  The `raw_disk` block supports:
    57  
    58  * `source` - (Required) The full Google Cloud Storage URL where the disk
    59      image is stored.
    60  
    61  * `sha1` - (Optional) SHA1 checksum of the source tarball that will be used
    62      to verify the source before creating the image.
    63  
    64  * `container_type` - (Optional) The format used to encode and transmit the
    65      block device. TAR is the only supported type and is the default.
    66  
    67  - - -
    68  
    69  * `project` - (Optional) The project in which the resource belongs. If it
    70      is not provided, the provider project is used.
    71  
    72  * `description` - (Optional) The description of the image to be created
    73  
    74  * `family` - (Optional) The name of the image family to which this image belongs.
    75  
    76  ## Attributes Reference
    77  
    78  In addition to the arguments listed above, the following computed attributes are
    79  exported:
    80  
    81  * `self_link` - The URI of the created resource.