- Evolution of Cloud + Infrastructure as Code (IaC)
- Terraform Overview + Setup
- Basic Terraform Usage
- Variables and Outputs
- Language Features
- Project Organization + Modules
- Managing Multiple Environments
- Testing Terraform Code
- Developer Workflows
Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently.
- According to HashiCorp
- Basic web application
- Infrastructure all within AWS
- Multiple instance running on EC2
- Using default VPC for simplicity
flowchart TD
A[Amazon Route 53] --> B[Elastic Load Balancing]
B --> Compute
subgraph Compute
C[Amazon EC2]
D[Amazon EC2]
end
subgraph Database
F[(Amazon RDS)]
end
Compute --- S
subgraph S[Amazon S3]
G[(Bucket)]
end
Compute --- Database
- Operational Overhead가 매우 Challanging했다.
- Capital Expenses를 운영자가 각각 부담해야 했다.
- On Promise -> Cloud (On Demand)
- Infrastructure provisioned via APIs.
- Servers created & destroyed in seconds.
- Long-lived + mutable -> Short-lived + immutable
- GUI (AWS Consoles, ...)
- API/CLI (AWS CLI, ...)
- IaC (Terraform, Serverless, ...)
코드 베이스로 인프라 프로비저닝이 가능함에 따라 일관된 설정과 구성을 명시적으로 나타내고 관리할 수 있다.
Categories of IaC tools: 1
- Ad hoc scripts
- Configuration management tools
- Server Templating tools
- Orchestration tools (e.g. Kubernetes)
- Provisioning tools
- Declarative(선언형) vs. Imperative(명령형)
- Cloud Formation
- Azure Resource Manager
- Google Cloud Deployment Manager
- Terraform
- Pulumi
- Serverless
1: From Terraform: Up & Running Writing Infrastructure as Code, Second Edition (O'Reilly Media, 2019) by Yevgeniy Brickman