Behavior of random_password

Hi @Justin-DynamicD,

All of the random provider resources follow a common pattern of generating a random value during their “create” action and then retaining it in the Terraform state so that it can be used for future operation. The value will not change until the resource object is subsequently destroyed for any reason.

You can use the keepers mechanism to give the resources hints about when they will need to replace themselves in order to generate a new random value. If keepers is not set then the value will be retained until you explicitly destroy the resource object.

2 Likes