Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Infrastructure as Code Overview

Imperative vs Declarative

AspectImperativeDeclarative
Approach“How to do it”“What I want”
ExampleBash scripts, PulumiTerraform, CloudFormation
StateYou manageTool manages
IdempotencyManualBuilt-in

Mutable vs Immutable Infrastructure

AspectMutableImmutable
UpdatesSSH + configure in placeReplace entire instance
ToolsAnsible, PuppetPacker + Terraform
DriftCommonImpossible
RollbackManualSwitch to old image

Key Tools

ToolTypeLanguageApproach
TerraformProvisioningHCLDeclarative
AnsibleConfigurationYAMLProcedural
PulumiProvisioningAny languageImperative
CloudFormationProvisioningJSON/YAMLDeclarative
CDKProvisioningAny languageImperative → declarative