summaryrefslogtreecommitdiff
path: root/docs/providers/libvirt
diff options
context:
space:
mode:
authorSilvio Moioli <smoioli@suse.de>2016-11-01 09:50:51 +0100
committerSilvio Moioli <smoioli@suse.de>2016-11-01 14:07:19 +0100
commitf79e0c835f0c49716e633ec12057804a8f15895b (patch)
tree72d268aba799c92182a3c0bc774ea16faca31d74 /docs/providers/libvirt
parent5a9475c31f4d0a5d4eb5396e6947490679eee956 (diff)
downloadterraform-provider-libvirt-f79e0c835f0c49716e633ec12057804a8f15895b.tar
terraform-provider-libvirt-f79e0c835f0c49716e633ec12057804a8f15895b.tar.gz
Allow to use maps for disk definitions
This changes the disk block in the domain resource to be defined as a map, instead of an object. There is no difference in the standard use case, but it allows to generate disk maps via interpolations and variables which is useful in modules.
Diffstat (limited to 'docs/providers/libvirt')
-rw-r--r--docs/providers/libvirt/r/domain.html.markdown35
1 files changed, 35 insertions, 0 deletions
diff --git a/docs/providers/libvirt/r/domain.html.markdown b/docs/providers/libvirt/r/domain.html.markdown
index d5fb93a2..e169c4dc 100644
--- a/docs/providers/libvirt/r/domain.html.markdown
+++ b/docs/providers/libvirt/r/domain.html.markdown
@@ -110,6 +110,41 @@ resource "libvirt_domain" "domain1" {
}
```
+Also note that the `disk` block is actually a list of maps, so it is possible to declare several, use the literal list and map syntax or variables and interpolations, as in the following examples.
+
+```
+resource "libvirt_domain" "my_machine" {
+ ...
+ disk {
+ volume_id = "${libvirt_volume.volume1.id}"
+ }
+ disk {
+ volume_id = "${libvirt_volume.volume2.id}"
+ }
+}
+```
+
+```
+resource "libvirt_domain" "my_machine" {
+ ...
+ disk = [
+ {
+ volume_id = "${libvirt_volume.volume1.id}"
+ },
+ {
+ volume_id = "${libvirt_volume.volume2.id}"
+ }
+ ]
+}
+```
+
+```
+resource "libvirt_domain" "my_machine" {
+ ...
+ disk = ["${var.disk_map_list}"]
+}
+```
+
The `network_interface` specifies a network interface that can be connected either to
a virtual network (the preferred method on hosts with dynamic / wireless networking
configs) or directly to a LAN.