Terraform Secrets and Sensitive Data#
Every Terraform configuration eventually needs a password, API key, or certificate. How you handle that secret determines whether it ends up in your state file (readable by anyone with state access), in plan output (visible in CI logs), in version control (permanent history), or properly managed through a secrets provider.
This article covers the patterns for handling secrets at every stage of the Terraform lifecycle — from variable declaration through state storage.