Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. Infrastructure as Code (Terraform, CloudFormation, Pulumi)

Cloud · General Cloud

Infrastructure as Code (Terraform, CloudFormation, Pulumi)

Mediumcloud-17
iacterraformcloudformationpulumidevops

Question

What is Infrastructure as Code, and how do Terraform, CloudFormation, and Pulumi differ?

Solution

Infrastructure as Code (IaC) means defining cloud resources (VPCs, buckets, IAM roles, warehouses) in files that are versioned, reviewed, and applied repeatably, instead of clicking in consoles.

code (Terraform / CFN / Pulumi)
        |
        v
   plan / preview
        |
        v
   apply --> cloud APIs create/update resources

Why DE teams care

Lakes, IAM, Glue jobs, and networking must be reproducible across dev/stage/prod. Console clicks drift and cannot be code-reviewed.

Tool contrast

| Tool | Style | Clouds | Notes | |---|---|---|---| | Terraform | HCL declarative | Multi-cloud | Huge ecosystem; state file | | AWS CloudFormation | YAML/JSON templates | AWS-only | Native AWS; StackSets | | Pulumi | Real languages (TS/Python/Go) | Multi-cloud | Prefer code over HCL |

Fresher example

A Terraform module creates an S3 bucket + IAM role + Glue job. PR review catches a public bucket ACL before apply.

Interview tip: Define IaC as versioned infra definitions, then say Terraform = multi-cloud HCL, CloudFormation = AWS-native, Pulumi = IaC in general-purpose languages.

PreviousNext