What is AWS CloudFormation, and how does it compare to Terraform?
AWS · Advanced level
Answer
CloudFormation is AWS-native IaC; Terraform is multi-provider IaC with external state. I choose based on ecosystem, governance, provider scope, module maturity, state model, and team standardization.
Technical explanation
Terraform state security and locking are operational responsibilities; CloudFormation stack state lives inside AWS.
Infrastructure as code should use reviewable plans/change sets, reusable modules, policy checks, drift detection, and controlled rollout pipelines.
Architecture reviews should produce prioritized risk remediation with owners and dates, not just high-level best-practice statements.
State, stack outputs, secrets, and deployment permissions must be secured because IaC pipelines often have powerful privileges.
Hands-on example
1. Model the resource or architecture through CloudFormation or Terraform rather than console changes.
2. Review the plan/change set for replacements, deletes, security exposure, and cost-impacting changes.
3. Apply in non-production, run validation tests, then promote through approval to production.
4. Run drift detection or state comparison afterward and remediate manual changes through code.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More AWS interview questions
- What is a CloudFormation change set and a drift detection?
- What is the difference between Secrets Manager and SSM Parameter Store?
- What is the difference between KMS and Secrets Manager?
- Compare backup-and-restore, pilot light, warm standby, and multi-site DR strategies.
- How do you detect and reduce unexpected AWS cost increases?
- What is the difference between an SQS standard and FIFO queue?
- What is AWS Systems Manager, and how is Session Manager safer than SSH bastions?
- What is an AMI, and how do you build standardised, hardened images?