InterviewStack.io LogoInterviewStack.io

Infrastructure Automation with Terraform/CloudFormation Questions

Writing production-quality infrastructure code. Topics include module design, variable validation, error handling, conditional logic, dynamic blocks, outputs for dependent systems, testing infrastructure changes, and documenting code. Writing code that's maintainable for other engineers and handles edge cases gracefully.

EasyTechnical
75 practiced
Explain Terraform lifecycle meta-arguments such as `create_before_destroy`, `prevent_destroy`, and `ignore_changes`. Provide examples of when each should be used and describe their risks and operational effects during apply and destroy operations.
HardTechnical
90 practiced
Provide a concrete Terraform plan for migrating state from one S3 backend to another with minimal downtime and without losing resources. Include steps for locking, snapshotting, migrating the state file, validating resource addresses, and rolling back if the migration introduces issues.
MediumTechnical
121 practiced
When and how should you use CloudFormation custom resources (Lambda-backed or other) to extend functionality? Describe common failure modes for custom resources, how to design idempotent custom resources, and strategies to test and monitor them in production.
HardSystem Design
62 practiced
Propose a guardrail and policy system to prevent accidental destroy of production resources when using Terraform and CloudFormation. Include policy-as-code examples (Sentinel, OPA/Gatekeeper), CI checks, manual approvals, tagging protections, and how to recover quickly if an accidental destroy occurs.
EasyTechnical
136 practiced
What should be included in a Terraform module README to make it production-quality and maintainable by other engineers? Provide a checklist covering inputs, outputs, examples, versioning notes, prerequisites, and testing instructions.

Unlock Full Question Bank

Get access to hundreds of Infrastructure Automation with Terraform/CloudFormation interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.