Interview Prep/Terraform/State Internals

Why is state a security concern, and what do you do about it?

AdvancedConceptState Internals
Answer

Passwords, private keys, connection strings and tokens from resources like aws_db_instance or tls_private_key are stored in plaintext. We encrypt the bucket with KMS, block public access, limit read access to a few roles, keep access logs, avoid terraform_remote_state for broad sharing and use ephemeral or write-only values to keep secrets out of state where providers support it.

All Terraform questions Roadmap: Terraform in production

More on State Internals