2014-08-26 23:50:29 +02:00
|
|
|
---
|
|
|
|
layout: "google"
|
|
|
|
page_title: "Google: google_compute_disk"
|
|
|
|
sidebar_current: "docs-google-resource-disk"
|
2014-10-22 05:21:56 +02:00
|
|
|
description: |-
|
|
|
|
Creates a new persistent disk within GCE, based on another disk.
|
2014-08-26 23:50:29 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# google\_compute\_disk
|
|
|
|
|
|
|
|
Creates a new persistent disk within GCE, based on another disk.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
resource "google_compute_disk" "default" {
|
|
|
|
name = "test-disk"
|
2014-10-07 06:59:09 +02:00
|
|
|
type = "pd-ssd"
|
2014-08-26 23:50:29 +02:00
|
|
|
zone = "us-central1-a"
|
|
|
|
image = "debian7-wheezy"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `name` - (Required) A unique name for the resource, required by GCE.
|
|
|
|
Changing this forces a new resource to be created.
|
|
|
|
|
|
|
|
* `zone` - (Required) The zone where this disk will be available.
|
|
|
|
|
2015-01-30 02:00:02 +01:00
|
|
|
* `image` - (Optional) The image from which to initialize this disk. Either the full URL, a
|
|
|
|
contraction of the form "project/name", or just a name (in which case the current project is
|
|
|
|
used).
|
2014-08-26 23:50:29 +02:00
|
|
|
|
|
|
|
* `size` - (Optional) The size of the image in gigabytes. If not specified,
|
|
|
|
it will inherit the size of its base image.
|
|
|
|
|
2014-10-07 06:59:09 +02:00
|
|
|
* `type` - (Optional) The GCE disk type.
|
|
|
|
|
2014-08-26 23:50:29 +02:00
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `name` - The name of the resource.
|
|
|
|
* `zone` - The zone where the resource is located.
|
|
|
|
* `image` - The name of the image the disk is based off of.
|
|
|
|
* `size` - The size of the disk in gigabytes.
|