Blog
Notes on platform engineering, Go, infrastructure, and SRE.
-
Mutable vs. immutable infrastructure, and lifecycle in Terraform
What separates a mutable deployment from an immutable one, why Terraform replaces resources by default instead of modifying them, and how to change that behavior with create_before_destroy, prevent_destroy and ignore_changes.
- terraform
- iac
- lifecycle
- best-practices
-
Useful Terraform commands: validate, fmt, show, providers, output, refresh and graph
What each of these commands does, how to use them in practice, and which ones actually belong in a CI pipeline (and which do not).
- terraform
- iac
- ci
- best-practices
-
Connecting resources in Terraform with attributes and outputs
How to reference one resource's attribute from another, how the implicit dependency graph this creates works, and how to expose those values when the run finishes with output blocks.
- terraform
- iac
- gcp
- best-practices
-
How to declare variables in Terraform
How to declare Terraform variables with type and description, the four ways to assign them a value (default, -var, TF_VAR_, tfvars files), and the precedence order when several of them compete for the same variable.
- terraform
- iac
- gcp
- best-practices
-
What Terraform providers are and how to use them
What a Terraform provider actually is, why you should pin its version with required_providers, what the .terraform.lock.hcl file is for, and how to configure the Google Cloud provider without putting credentials in your code.
- terraform
- iac
- gcp
- best-practices
-
Remote state in Terraform: a bucket, a lock, and no more stepping on each other
What Terraform's state file is, why keeping it on your laptop doesn't scale in a team, and how to move it to a Google Cloud Storage bucket with locking so two people can't apply changes at the same time.
- terraform
- iac
- gcp
- teams
-
Installing Terraform: binary, apt and Docker (with a Makefile)
Three ways to install Terraform on Linux (the official binary, the HashiCorp apt repository and Docker) plus a Makefile that turns the Docker command into a simple make plan.
- terraform
- iac
- docker
- linux
-
From Snapshots to Infrastructure as Code
Snapshots, Terminator broadcast and clicking around the GCP console. A short look back at how we used to provision servers, and why we ended up declaring infrastructure as code.
- terraform
- iac
- infrastructure
- gcp