Infrastructure as code

Handle Terraform state carefully

State records the relationship between configuration and managed infrastructure.

Protect state

Store state in a secured remote backend with appropriate access controls and locking. State can contain sensitive values even when outputs are marked sensitive.

Review changes

Generate and review a plan in the correct workspace before applying. Limit who can apply changes and retain the plan and approval record according to your process.

Prepare recovery

Enable appropriate backend versioning and practice recovery. Coordinate changes to avoid concurrent modifications and state drift.