@@ -29,6 +29,7 @@ terraform {
29
29
## Usage
30
30
``` hcl
31
31
resource "vagrant_vm" "my_vagrant_vm" {
32
+ name = "vagrantbox"
32
33
vagrantfile_dir = "path/to/dir"
33
34
env = {
34
35
KEY = "value",
@@ -37,17 +38,21 @@ resource "vagrant_vm" "my_vagrant_vm" {
37
38
}
38
39
```
39
40
41
+ ** name** (optional) if the name changes, it will force the resource to destroy
42
+ and recreate. Defaults to "vagrantbox".
43
+
40
44
** vagrantfile_dir** is the path to a directory where a Vagrantfile lives. The
41
45
Vagrantfile must exist when terraform runs or else it will throw an error. This
42
46
option defaults to ` . ` , ie, the current directory and you may set this value to
43
47
absolute or relative paths.
44
48
45
- ** env** is a map of additional environment variables to pass to the Vagrantfile.
46
- The environment variables set by the calling process are always passed.
49
+ ** env** (optional) is a map of additional environment variables to pass to the
50
+ Vagrantfile. The environment variables set by the calling process are always
51
+ passed.
47
52
48
- ** get_ports** if ` true ` , information about forwarded ports will be filled in
49
- (see ` ports ` below). This is ` false ` by default because it may take some time
50
- to run.
53
+ ** get_ports** (optional) if ` true ` , information about forwarded ports will be
54
+ filled in (see ` ports ` below). This is ` false ` by default because it may take
55
+ some time to run.
51
56
52
57
If you have multiple Vagrantfiles, provide an ` alias ` in the ` provider ` block
53
58
and use the ` provider ` meta-argument in the resource/data-source
@@ -103,6 +108,12 @@ resource "vagrant_vm" "my_vagrant_vm" {
103
108
When the file changes, the hash will change, and terraform will ask for an
104
109
update.
105
110
111
+ ### Really Forcing an Update
112
+ Changing an environment variable, as suggested above, essentially runs `vagrant
113
+ reload` . Sometimes this isn't enough. If the resource's ` name` changes, it will
114
+ signal to terraform that it needs to completely destroy the resource and
115
+ recreate it.
116
+
106
117
## Removing Machines
107
118
Sadly, due to some limitations in vagrant, it's not possible to automatically
108
119
remove a portion of machines from a Vagrantfile. In other words, if your
0 commit comments