mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-03 08:42:39 +00:00
Update attached disk documentation (#3413)
<!-- This change is generated by MagicModules. --> Original Author: @chrisst
This commit is contained in:
parent
607ed70849
commit
9f06d8a085
|
@ -22,6 +22,7 @@ To get more information about attaching disks, see:
|
||||||
* How-to Guides
|
* How-to Guides
|
||||||
* [Adding a persistent disk](https://cloud.google.com/compute/docs/disks/add-persistent-disk)
|
* [Adding a persistent disk](https://cloud.google.com/compute/docs/disks/add-persistent-disk)
|
||||||
|
|
||||||
|
**Note:** When using `compute_attached_disk` you **must** use `lifecycle.ignore_changes = ["attached_disk"]` on the `compute_instance` resource that has the disks attached. Otherwise the two resources will fight for control of the attached disk block.
|
||||||
|
|
||||||
## Example Usage
|
## Example Usage
|
||||||
```hcl
|
```hcl
|
||||||
|
@ -29,6 +30,27 @@ resource "google_compute_attached_disk" "default" {
|
||||||
disk = "${google_compute_disk.default.self_link}"
|
disk = "${google_compute_disk.default.self_link}"
|
||||||
instance = "${google_compute_instance.default.self_link}"
|
instance = "${google_compute_instance.default.self_link}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "google_compute_instance" "default" {
|
||||||
|
name = "attached-disk-instance"
|
||||||
|
machine_type = "n1-standard-1"
|
||||||
|
zone = "us-west1-a"
|
||||||
|
|
||||||
|
|
||||||
|
boot_disk {
|
||||||
|
initialize_params {
|
||||||
|
image = "debian-cloud/debian-9"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
network_interface {
|
||||||
|
network = "default"
|
||||||
|
}
|
||||||
|
|
||||||
|
lifecycle {
|
||||||
|
ignore_changes = ["attached_disk"]
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Argument Reference
|
## Argument Reference
|
||||||
|
@ -77,7 +99,7 @@ The following arguments are supported:
|
||||||
The mode in which to attach this disk, either READ_WRITE or
|
The mode in which to attach this disk, either READ_WRITE or
|
||||||
READ_ONLY. If not specified, the default is to attach the disk in
|
READ_ONLY. If not specified, the default is to attach the disk in
|
||||||
READ_WRITE mode.
|
READ_WRITE mode.
|
||||||
|
|
||||||
Possible values:
|
Possible values:
|
||||||
"READ_ONLY"
|
"READ_ONLY"
|
||||||
"READ_WRITE"
|
"READ_WRITE"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user