mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 18:01:01 -06:00
Merge pull request #31545 from hashicorp/module-invocation-warning
Add note about module.path and local module sources
This commit is contained in:
commit
aecbaecff5
@ -118,14 +118,15 @@ to mark the reference as for a data resource.
|
||||
|
||||
### Filesystem and Workspace Info
|
||||
|
||||
* `path.module` is the filesystem path of the module where the expression
|
||||
is placed.
|
||||
* `path.root` is the filesystem path of the root module of the configuration.
|
||||
* `path.cwd` is the filesystem path of the current working directory. In
|
||||
The following values are available:
|
||||
|
||||
- `path.module` is the filesystem path of the module where the expression is placed. We do not recommend using `path.module` in write operations because it can produce different behavior depending on whether you use remote or local module sources. Multiple invocations of local modules use the same source directory, overwriting the data in `path.module` during each call. This can lead to race conditions and unexpected results.
|
||||
- `path.root` is the filesystem path of the root module of the configuration.
|
||||
- `path.cwd` is the filesystem path of the current working directory. In
|
||||
normal use of Terraform this is the same as `path.root`, but some advanced
|
||||
uses of Terraform run it from a directory other than the root module
|
||||
directory, causing these paths to be different.
|
||||
* `terraform.workspace` is the name of the currently selected
|
||||
- `terraform.workspace` is the name of the currently selected
|
||||
[workspace](/language/state/workspaces).
|
||||
|
||||
Use the values in this section carefully, because they include information
|
||||
|
Loading…
Reference in New Issue
Block a user