Interview Prep/Terraform/HCP Terraform, OpenTofu, Scale and Cost

How do you shut down non-production environments out of hours?

IntermediateProductionHCP Terraform, OpenTofu, Scale and Cost
Answer

Options: scheduled pipeline running terraform destroy on preview stacks (and apply in the morning), an ASG aws_autoscaling_schedule or Instance Scheduler for stateful but idle resources, or TTL tags and a janitor. Destroy/apply cycles are only safe for stacks with no state worth keeping, so keep data layers separate.

All Terraform questions

More on HCP Terraform, OpenTofu, Scale and Cost