ephemeral values
Values, added in Terraform 1.10, that exist only during a run and are never written to state or plan files.
In more detail
Ephemeral input variables and outputs, and ephemeral resources that fetch a secret at run time, keep credentials out of storage entirely. They can only be used where Terraform knows they will not be persisted, such as provider configuration or write-only arguments. They reduce what state exposes but do not replace access control and rotation.
Example
variable "db_password" {
type = string
ephemeral = true
}Related terms
- write-only argument — A resource argument, added in Terraform 1.11, that is sent to the provider but never stored in plan or state, typically a password.
- 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.
- secret — Any value that grants access, such as a password, access token or private key, and must be kept out of code and version control.
- Terraform state — Terraform's record, usually a JSON file called terraform.tfstate, mapping each resource in the configuration to the real object it created.
Related guides
Taught in
- The Problem With Local State — Infrastructure as Code with Terraform
- Configuring A Remote Backend — Infrastructure as Code with Terraform
- State Locking With Use Lockfile — Infrastructure as Code with Terraform
- Workspaces For Multiple Environments — Infrastructure as Code with Terraform
- Security: Secrets In State And Ephemeral Values — Infrastructure as Code with Terraform
- Custom Conditions: Validation, Pre And Postconditions, Checks — HashiCorp Terraform Associate (004) Exam Prep
- Sensitive Data, Ephemeral Values And Secrets From Vault — HashiCorp Terraform Associate (004) Exam Prep