mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-21 10:47:34 -05:00
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com> Signed-off-by: Damian Stasik <920747+damianstasik@users.noreply.github.com> Signed-off-by: Roman Grinovski <roman.grinovski@gmail.com> Co-authored-by: Damian Stasik <920747+damianstasik@users.noreply.github.com> Co-authored-by: Roman Grinovski <roman.grinovski@gmail.com>
24 lines
798 B
Plaintext
24 lines
798 B
Plaintext
---
|
|
sidebar_label: abspath
|
|
description: The abspath function converts the argument to an absolute filesystem path.
|
|
---
|
|
|
|
# `abspath` Function
|
|
|
|
`abspath` takes a string containing a filesystem path and converts it
|
|
to an absolute path. That is, if the path is not absolute, it will be joined
|
|
with the current working directory.
|
|
|
|
Referring directly to filesystem paths in resource arguments may cause
|
|
spurious diffs if the same configuration is applied from multiple systems or on
|
|
different host operating systems. We recommend using filesystem paths only
|
|
for transient values, such as the argument to [`file`](../../language/functions/file.mdx) (where
|
|
only the contents are then stored) or in `connection` and `provisioner` blocks.
|
|
|
|
## Examples
|
|
|
|
```
|
|
> abspath(path.root)
|
|
/home/user/some/tofu/root
|
|
```
|