terraform-provider-google/r/compute_disk.html.markdown
Dana Hoffman 7974fd1a41 providers/google: Add support for encrypting a disk (#11167)
* providers/google: add support for encrypting a disk

* providers/google: Add docs for encrypting disks

* providers/google: CSEK small fixes: sensitive params and mismatched state files
2017-01-18 13:49:48 +00:00

65 lines
2.0 KiB
Markdown

---
layout: "google"
page_title: "Google: google_compute_disk"
sidebar_current: "docs-google-compute-disk"
description: |-
Creates a new persistent disk within GCE, based on another disk.
---
# google\_compute\_disk
Creates a new persistent disk within GCE, based on another disk.
## Example Usage
```js
resource "google_compute_disk" "default" {
name = "test-disk"
type = "pd-ssd"
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.
- - -
* `disk_encryption_key_raw` - (Optional) A 256-bit [customer-supplied encryption key]
(https://cloud.google.com/compute/docs/disks/customer-supplied-encryption),
encoded in [RFC 4648 base64](https://tools.ietf.org/html/rfc4648#section-4)
to encrypt this disk.
* `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).
* `project` - (Optional) The project in which the resource belongs. If it
is not provided, the provider project is used.
* `size` - (Optional) The size of the image in gigabytes. If not specified, it
will inherit the size of its base image.
* `snapshot` - (Optional) Name of snapshot from which to initialize this disk.
* `type` - (Optional) The GCE disk type.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are
exported:
* `disk_encryption_key_sha256` - The [RFC 4648 base64]
(https://tools.ietf.org/html/rfc4648#section-4) encoded SHA-256 hash of the
[customer-supplied encryption key](https://cloud.google.com/compute/docs/disks/customer-supplied-encryption)
that protects this resource.
* `self_link` - The URI of the created resource.