So, you’ve been working away, adding files, & committing them locally. Everything is going great. But inevitably, things go wrong. You log in one morning, look at the script you updated late last night, & realize it completely broke the…
Up to now, our Git workflow has been a straight single line. You make a change, you commit it, & the history moves forward. That works perfectly if you’re the only person working & you never make a mistake or…
Up until now, every commit, branch, & revert we’ve done has stayed entirely inside your local laptop. See, if your hard drive crashes right now, your entire project history goes with it. The problem here is that we can’t just…
Importing Existing Resources into Terraform 🔧 Terraform Core ⭐ Intermediate import block terraform import -generate-config-out Scenario Your team created S3 buckets via the AWS console before adopting Terraform. Now you want to bring them under Terraform management without deleting and…
terraform state Commands: Inspecting and Manipulating State 🔧 Terraform Core ⭐ Intermediate state list state show state mv state rm state pull Scenario You need to rename a resource in your config without destroying and recreating it. You also want…
for_each: Creating Resources from Maps and Sets 🔧 Terraform Core ⭐ Beginner for_each each.key each.value toset() count vs for_each Scenario Your team stores configuration values in AWS Systems Manager Parameter Store. You need to create several parameters with different names…
count: Creating Multiple Resources from One Block 🔧 Terraform Core ⭐ Beginner count count.index Conditional Creation splat [*] Scenario Your team needs three identical S3 buckets for different data partitions — but you don’t want to write three separate resource…
Resource Dependencies: Implicit, Explicit and the Dependency Graph 🔧 Terraform Core ⭐ Beginner Implicit Dependencies depends_on terraform graph Execution Order Scenario You need to create an S3 bucket and an SQS queue, where the queue’s name includes the bucket name.…
Data Sources: Reading Existing Infrastructure 🔧 Terraform Core ⭐ Beginner data aws_caller_identity aws_region aws_vpc Filters Read-Only Scenario Your configuration needs to reference infrastructure that already exists — the current AWS account ID, the current region, the default VPC ID. You…
Locals: DRY Configuration with Computed Values 🔧 Terraform Core ⭐ Beginner locals local.* merge() DRY Principle Scenario You have a configuration where the same tag map, naming prefix, and computed values are repeated across a dozen resources. Every time you…
Establish a Persistent Connection
Like the content ? Get notified when I post something new. I promise not to spam your Email.