github.com/bengesoff/terraform@v0.3.1-0.20141018223233-b25a53629922/website/source/docs/providers/google/r/compute_instance.html.markdown (about)

     1  ---
     2  layout: "google"
     3  page_title: "Google: google_compute_instance"
     4  sidebar_current: "docs-google-resource-instance"
     5  ---
     6  
     7  # google\_compute\_instance
     8  
     9  Manages a VM instance resource within GCE.
    10  
    11  ## Example Usage
    12  
    13  ```
    14  resource "google_compute_instance" "default" {
    15  	name = "test"
    16  	machine_type = "n1-standard-1"
    17  	zone = "us-central1-a"
    18  	tags = ["foo", "bar"]
    19  
    20  	disk {
    21  		image = "debian-7-wheezy-v20140814"
    22  	}
    23  
    24  	network {
    25  		source = "default"
    26  	}
    27  
    28  	metadata {
    29  		foo = "bar"
    30  	}
    31  }
    32  ```
    33  
    34  ## Argument Reference
    35  
    36  The following arguments are supported:
    37  
    38  * `name` - (Required) A unique name for the resource, required by GCE.
    39      Changing this forces a new resource to be created.
    40  
    41  * `description` - (Optional) A brief description of this resource.
    42  
    43  * `machine_type` - (Required) The machine type to create.
    44  
    45  * `zone` - (Required) The zone that the machine should be created in.
    46  
    47  * `disk` - (Required) Disks to attach to the instance. This can be specified
    48      multiple times for multiple disks. Structure is documented below.
    49  
    50  * `can_ip_forward` - (Optional) Whether to allow sending and receiving of
    51      packets with non-matching source or destination IPs.
    52      This defaults to false.
    53  
    54  * `metadata` - (Optional) Metadata key/value pairs to make available from
    55      within the instance.
    56  
    57  * `network` - (Required) Networks to attach to the instance. This can be
    58      specified multiple times for multiple networks. Structure is documented
    59      below.
    60  
    61  * `tags` - (Optional) Tags to attach to the instance.
    62  
    63  The `disk` block supports:
    64  
    65  * `disk` - (Required if image not set) The name of the disk (such as
    66       those managed by `google_compute_disk`) to attach.
    67  
    68  * `image` - (Required if disk not set) The name of the image to base
    69      this disk off of.
    70  
    71  * `auto_delete` - (Optional) Whether or not the disk should be auto-deleted.
    72      This defaults to true.
    73  
    74  * `type` - (Optional) The GCE disk type.
    75  
    76  The `network` block supports:
    77  
    78  * `source` - (Required) The name of the network to attach this interface to.
    79  
    80  * `address` - (Optional) The IP address of a reserved IP address to assign
    81       to this interface.
    82  
    83  ## Attributes Reference
    84  
    85  The following attributes are exported:
    86  
    87  * `name` - The name of the resource.
    88  * `machine_type` - The type of machine.
    89  * `zone` - The zone the machine lives in.