github.com/rstandt/terraform@v0.12.32-0.20230710220336-b1063613405c/website/docs/configuration/functions/abspath.html.md (about) 1 --- 2 layout: "functions" 3 page_title: "abspath - Functions - Configuration Language" 4 sidebar_current: "docs-funcs-file-abspath" 5 description: |- 6 The abspath function converts the argument to an absolute filesystem path. 7 --- 8 9 # `abspath` Function 10 11 -> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and 12 earlier, see 13 [0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). 14 15 `abspath` takes a string containing a filesystem path and converts it 16 to an absolute path. That is, if the path is not absolute, it will be joined 17 with the current working directory. 18 19 Referring directly to filesystem paths in resource arguments may cause 20 spurious diffs if the same configuration is applied from multiple systems or on 21 different host operating systems. We recommend using filesystem paths only 22 for transient values, such as the argument to [`file`](./file.html) (where 23 only the contents are then stored) or in `connection` and `provisioner` blocks. 24 25 ## Examples 26 27 ``` 28 > abspath(path.root) 29 /home/user/some/terraform/root 30 ```