Introduction
Sometimes you need to keep secrets like passwords or keys safe when using Terraform. Sensitive variables help hide these secrets so they don't show up in logs or outputs.
When you need to store a database password in your Terraform configuration without exposing it.
When you want to keep API keys secret while deploying cloud resources.
When sharing Terraform code but want to avoid leaking sensitive information.
When you want Terraform to warn you if a secret is accidentally printed.
When you want to pass sensitive data securely between Terraform modules.