Your First Resource
Init, plan, apply: the cycle you will repeat thousands of times.
Your First Resource, from an Empty File to an Applied Plan
Most Terraform beginnings fail because of the same misunderstanding: people believe terraform apply is the command that matters. It isn't. apply is just the mechanical execution of a decision that has already been made. The command that matters is plan, because it is the only one that shows you what the tool has understood of your intent before anything moves. An engineer who applies without reading the plan has swapped a web console for a terminal, with no gain in safety.
This lesson therefore builds the complete cycle on a minimal example — a storage bucket, a machine, a security group — but spends a good deal of time on reading the output of plan. The goal is not to have created a resource by the end; it is to be able to answer the question "what exactly is this command going to do?" before running it. The rest of the course assumes this reflex is second nature.
Installing
Terraform is a single binary with no runtime dependencies. There are three ways to install it, depending on your workstation:
# macOS, via Homebrew
brew tap hashicorp/tap
brew install hashicorp/tap/terraform
Comments
Comments are powered by GitHub Discussions
Sign in with GitHub to join the discussion