github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/job-specification/hcl2/functions/uuid/uuidv4.mdx (about) 1 --- 2 layout: docs 3 page_title: v4 - uuid - Functions - Configuration Language 4 description: The uuidv4 function generates a unique id. 5 --- 6 7 # `uuidv4` Function 8 9 `uuidv4` generates a unique identifier string. 10 11 The id is a generated and formatted as required by [RFC 4122 section 12 4.4](https://tools.ietf.org/html/rfc4122#section-4.4), producing a Version 4 13 UUID. The result is a UUID generated only from pseudo-random numbers. 14 15 This function produces a new value each time it is called, and so using it 16 directly in job arguments will result in spurious diffs. We do not 17 recommend using the `uuidv4` function in resource configurations. 18 19 ## Examples 20 21 ```shell-session 22 > uuidv4() 23 b5ee72a3-54dd-c4b8-551c-4bdc0204cedb 24 ``` 25 26 ## Related Functions 27 28 - [`uuidv5`](/docs/job-specification/hcl2/functions/uuid/uuidv5), which generates name-based UUIDs.