github.com/adrian-bl/terraform@v0.7.0-rc2.0.20160705220747-de0a34fc3517/website/source/docs/providers/random/r/shuffle.html.md (about) 1 --- 2 layout: "random" 3 page_title: "Random: random_shuffle" 4 sidebar_current: "docs-random-resource-shuffle" 5 description: |- 6 Produces a random permutation of a given list. 7 --- 8 9 # random\_shuffle 10 11 The resource `random_shuffle` generates a random permutation of a list 12 of strings given as an argument. 13 14 ## Example Usage 15 16 ``` 17 resource "random_shuffle" "az" { 18 input = ["us-west-1a", "us-west-1c", "us-west-1d", "us-west-1e"] 19 result_count = 2 20 } 21 22 resource "aws_elb" "example" { 23 # Place the ELB in any two of the given availability zones, selected 24 # at random. 25 availability_zones = ["${random_shuffle.az.result}"] 26 27 # ... and other aws_elb arguments ... 28 } 29 ``` 30 31 ## Argument Reference 32 33 The following arguments are supported: 34 35 * `input` - (Required) The list of strings to shuffle. 36 37 * `result_count` - (Optional) The number of results to return. Defaults to 38 the number of items in the `input` list. If fewer items are requested, 39 some elements will be excluded from the result. If more items are requested, 40 items will be repeated in the result but not more frequently than the number 41 of items in the input list. 42 43 * `keepers` - (Optional) Arbitrary map of values that, when changed, will 44 trigger a new id to be generated. See 45 [the main provider documentation](../index.html) for more information. 46 47 * `seed` - (Optional) Arbitrary string with which to seed the random number 48 generator, in order to produce less-volatile permutations of the list. 49 **Important:** Even with an identical seed, it is not guaranteed that the 50 same permutation will be produced across different versions of Terraform. 51 This argument causes the result to be *less volatile*, but not fixed for 52 all time. 53 54 ## Attributes Reference 55 56 The following attributes are exported: 57 58 * `result` - Random permutation of the list of strings given in `input`. 59