Skip to content

Commit

Permalink
fix instance template interaction with regional disks, make docs more…
Browse files Browse the repository at this point in the history
… clear about valid values (hashicorp#2138)
  • Loading branch information
danawillow authored Oct 1, 2018
1 parent 73448ec commit dcea78c
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions docs/r/compute_instance_template.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ resource "google_compute_instance_template" "default" {
// Use an existing disk resource
disk {
source = "foo_existing_disk"
// Instance Templates reference disks by name, not self link
source = "${google_compute_disk.foobar.name}"
auto_delete = false
boot = false
}
Expand All @@ -62,6 +63,19 @@ resource "google_compute_instance_template" "default" {
scopes = ["userinfo-email", "compute-ro", "storage-ro"]
}
}
data "google_compute_image" "my_image" {
family = "debian-9"
project = "debian-cloud"
}
resource "google_compute_disk" "foobar" {
name = "existing-disk"
image = "${data.google_compute_image.my_image.self_link}"
size = 10
type = "pd-ssd"
zone = "us-central1-a"
}
```

## Using with Instance Group Manager
Expand Down Expand Up @@ -260,9 +274,8 @@ The `disk` block supports:
or READ_ONLY. If you are attaching or creating a boot disk, this must
read-write mode.

* `source` - (Required if source_image not set) The name of the disk (such as
those managed by `google_compute_disk`) to attach. This cannot be a regional
disk.
* `source` - (Required if source_image not set) The name (**not self_link**)
of the disk (such as those managed by `google_compute_disk`) to attach.

* `disk_type` - (Optional) The GCE disk type. Can be either `"pd-ssd"`,
`"local-ssd"`, or `"pd-standard"`.
Expand Down

0 comments on commit dcea78c

Please sign in to comment.