Interview Prep/Terraform/Security, Secrets and Access

How do you rotate a secret that Terraform created?

IntermediateProductionSecurity, Secrets and Access
Answer

Avoid Terraform-owned rotation. Create the secret shell with Terraform, let Secrets Manager rotation or the service rotate it and add lifecycle { ignore_changes = [secret_string] } if Terraform sets the initial value. If you must rotate via Terraform, taint or replace random_password (or change its keepers) and apply, accepting the new value lands in state.

All Terraform questions Roadmap: Terraform in production

More on Security, Secrets and Access