基础设施即代码 (Infrastructure as Code, IaC) 是指通过 代码/配置文件 而不是手动设置来定义和管理基础设施(服务器、网络、数据库)。CloudFormation、Terraform 和 CDK 等工具使基础设施变得可重复、可版本控制和可自动化。
IaC 解决的问题
MANUALLY setting up infrastructure (clicking in the Console) is:
→ not REPEATABLE (hard to recreate identically; error-prone)
→ not VERSIONED (no history of what changed, by whom, why)
→ not DOCUMENTED (the setup lives only in someone's memory/clicks)
→ hard to review, share, or roll back
→ IaC defines infrastructure in CODE → solving all of this.
