random provider
HashiCorp's provider that generates random values, such as passwords or names, and keeps them stable in state.
In more detail
A random value is generated once, at create time, and then read back from state on every later plan, so it does not change each run. random_password marks its result as sensitive, but the value is still stored in state in plain text.
Example
output "admin_password" {
value = random_password.admin.result
sensitive = true
}Related terms
- provider — A plugin that teaches Terraform how to talk to one API, such as AWS or your local disk, and which resource types it offers.
- sensitive value — A variable or output marked sensitive = true, which Terraform hides in plan output and the terminal but still stores in state in plain text.
- Terraform state — Terraform's record, usually a JSON file called terraform.tfstate, mapping each resource in the configuration to the real object it created.
Taught in
- Providers And The required_providers Block — Infrastructure as Code with Terraform
- Return Values: Outputs And Locals — Infrastructure as Code with Terraform
- The Plan That Wanted To Destroy Production — HashiCorp Terraform Associate (004) Exam Prep
- Providers: How Terraform Reaches Every API — HashiCorp Terraform Associate (004) Exam Prep
- Versions, The Lock File And Provider Aliases — HashiCorp Terraform Associate (004) Exam Prep
- Write, Plan, Apply, And What Init Prepares — HashiCorp Terraform Associate (004) Exam Prep
- Sensitive Data, Ephemeral Values And Secrets From Vault — HashiCorp Terraform Associate (004) Exam Prep