random_shuffle (Resource)

The resource random_shuffle generates a random permutation of a list of strings given as an argument.

Example Usage

resource "random_shuffle" "az" {
  input        = ["us-west-1a", "us-west-1c", "us-west-1d", "us-west-1e"]
  result_count = 2
}

resource "aws_elb" "example" {
  # Place the ELB in any two of the given availability zones, selected
  # at random.
  availability_zones = random_shuffle.az.result

  # ... and other aws_elb arguments ...
}

Schema

Required

Optional

Important: Even with an identical seed, it is not guaranteed that the same permutation will be produced across different versions of Terraform. This argument causes the result to be less volatile, but not fixed for all time.

Read-Only