title: Generate random value once in terraform
body: <p>I have some AWS RDS databases that I want to distribute over different availability zones, this can be done like this:</p>
  
  <pre><code>resource "random_shuffle" "az" {
    input        = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
    result_count = 1
  }
  
  resource "aws_db_instance" "mydb" {
    availability_zone = random_shuffle.az.result[0]
  }
  </code></pre>
  
  <p>The problem is that I do not want the az to ever change after the resource is created, because this would cause the resource to be destroyed.</p>
  
  <p>This is a problem, because if I add/remove a item to the list a new random value will be picked.</p>
  
  <p>How can I achieve this "pick a random value only once" behavior? </p>