MidnightTokensdeveloper portal
Sign In
Unit Study Document

Infrastructure as Code: Terraform & GitOps

7 min readβ€’Visual explainer included

Managing Infrastructure as Text

Setting up servers manually in the AWS or Google Cloud web consoles is slow, error-prone, and impossible to audit. Modern cloud engineering uses Infrastructure as Code (IaC). We write configuration files defining our infrastructure, and let a tool compile and provision the physical state.

GitOps Pipeline: Infrastructure changes are submitted via Pull Requests. Once approved and merged, CI/CD runners apply changes (e.g. terraform apply) automatically.

Declarative Terraform Blueprint

# Define a virtual server in AWS
resource "aws_instance" "app_server" {
 ami = "ami-0c55b159cbfafe1f0"
 instance_type = "t3.micro"

 tags = {
 Name = "DevCafeWebServer"
 }
}
Fast Drill

Active Recalls

Card 1 of 1
Question

What is declarative infrastructure?

Tap card to flip
Answer

Defining the desired final state of your infrastructure, leaving the tool (like Terraform) to calculate the steps to achieve it.

Mastery: 0%
Knowledge Check

Quiz Practice

Question 1 of 1
What is the purpose of the Terraform state file?

Chapter Scratchpad

Auto-saves immediately

Active Recall Cards

Review core concepts before doing the quiz

Fast Drill

Active Recalls

Card 1 of 1
Question

What is declarative infrastructure?

Tap card to flip
Answer

Defining the desired final state of your infrastructure, leaving the tool (like Terraform) to calculate the steps to achieve it.

Mastery: 0%

AI Study Buddy

Always online

Hi! I'm Spooky, your study buddy! Let's learn together.