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.
More on State Internals
What does the state file contain?BeginnerWhat is the difference between local and remote state?BeginnerHow do you configure the S3 backend?BeginnerWhat is state locking and why does it matter?IntermediateHow does S3-native locking work and how does it replace DynamoDB?AdvancedHow do you inspect resources in state?Beginner