We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Devops Cicd
Free preview: the first 2 parts of this 7-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Devops Cicd
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
A production server that had been running for three years crashed and could not be recovered. It had been set up manually: someone clicked through the AWS console, installed packages via SSH, configured services by hand. Nobody documented the steps. Nobody could reproduce the environment. Rebuilding it took an engineer 4 days of detective work, reading shell history files, comparing packages with other servers, and guessing configurations.
Infrastructure as Code (IaC) means defining your entire infrastructure in code files. Servers, databases, load balancers, records, IAM roles, VPCs. All of it. Terraform, Pulumi, AWS CDK, or CloudFormation describe the desired state. The tool creates, updates, or destroys resources to match. Rebuilding any environment is terraform apply. Minutes, not days.
HashiCorp reports that organizations using provision infrastructure 33% faster and experience 50% fewer misconfigurations compared to manual provisioning. Netflix manages thousands of AWS resources through IaC. Shopify provisions new regions by running their Terraform modules against a new AWS account.
| Tool | Language | Cloud Support | State Management | Learning Curve |
|---|---|---|---|---|
| HCL | Multi-cloud (AWS, GCP, Azure, 1000+ providers) | State file (S3, Terraform Cloud) | Medium | |
| Pulumi | TypeScript, Python, Go, C# | Multi-cloud | Managed by Pulumi Cloud or self-hosted | Low (familiar languages) |
| AWS CDK | TypeScript, Python, Java, C# | AWS only | CloudFormation underneath | Medium |
| CloudFormation | YAML/JSON | AWS only | Managed by AWS | High (verbose YAML) |
| Crossplane | YAML (K8s CRDs) | Multi-cloud | control plane | High |
Declarative vs imperative:
| Approach | You Describe | Tool Does | Example |
|---|---|---|---|
| Declarative | "I want 3 servers behind a " | Figures out what to create, update, or destroy | Terraform, CloudFormation |
| Imperative | "Create server 1. Create server 2. Create server 3. Create LB. Attach servers." | Executes steps in order | Bash scripts, some Pulumi patterns |
Declarative is preferred because it is . Running terraform apply twice produces the same result. Running a bash script twice might create duplicate resources.
State management is the hardest part. Terraform tracks every resource it manages in a state file. This JSON file maps your code to real cloud resources. If the state file is lost or corrupted, Terraform loses track of what exists and may try to recreate everything.
Store state remotely (S3 bucket with versioning + DynamoDB locking) so that:
It is easy and good
“It is really nice and good Please join the course”