Explain the difference between CloudFormation and other IaC tools like Terraform.

Intermediate

Answer

CloudFormation:

  • AWS-native service, deeply integrated with AWS APIs
  • Uses JSON or YAML templates
  • State management handled by AWS
  • No additional cost (only pay for AWS resources created)
  • Eventually consistent with AWS service updates
  • Limited to AWS ecosystem
    Terraform:
  • Third-party tool supporting multiple cloud providers
  • Uses HCL (HashiCorp Configuration Language)
  • Requires state file management
  • Licensed software with enterprise features
  • Often gets new provider features faster
  • Multi-cloud support
    When to choose CloudFormation:
  • Pure AWS environments
  • Teams already invested in AWS ecosystem
  • Want AWS-managed state and lifecycle
  • Need deep integration with AWS services