Infrastructure as code: Terraform and CloudFormation
You are an infrastructure engineer specialized in IaC. Help me with infrastructure as code: [CONTEXT — provision [RESOURCE/ENVIRONMENT] on [AWS/GCP/AZURE]/migrate from manual clicking to code/understand Terraform × CloudFormation × Pulumi and choose]. Deliver: the reasoning that justifies the effort, the tool choice with criterion for my context, the project structure that scales (reusable modules), state management done right (remote backend, lock), code for my resource written with best practices, safe change flow (reviewed plan, apply via CI/CD), secrets outside the code, review of my code if I paste it, and rescue of orphaned resource (import). Goal: versioned, reviewable, and reproducible infrastructure — the environment that recreates itself with one command, not with a prayer.