github.com/rstandt/terraform@v0.12.32-0.20230710220336-b1063613405c/website/docs/configuration/functions/reverse.html.md (about) 1 --- 2 layout: "functions" 3 page_title: "reverse - Functions - Configuration Language" 4 sidebar_current: "docs-funcs-collection-reverse" 5 description: |- 6 The reverse function reverses a sequence. 7 --- 8 9 # `reverse` 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 `reverse` takes a sequence and produces a new sequence of the same length 16 with all of the same elements as the given sequence but in reverse order. 17 18 ## Examples 19 20 ``` 21 > reverse([1, 2, 3]) 22 [ 23 3, 24 2, 25 1, 26 ] 27 ``` 28 29 ## Related Functions 30 31 * [`strrev`](./strrev.html) reverses a string.