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