Interview Prep/Terraform/Security, Secrets and Access

Is reading a secret with a data source safe?

IntermediateProductionSecurity, Secrets and Access
Answer

Reading is fine from an IAM standpoint, but the value lands in state in plaintext (even if marked sensitive) and can show up in plans if used in a resource attribute. Better is to pass the secret's ARN and let the workload read it at runtime. Where Terraform must use the value, prefer ephemeral resources.

All Terraform questions Roadmap: Terraform in production

More on Security, Secrets and Access