Plan and review
The only moment when a mistake still costs nothing.
Reviewing a Plan Before You Apply
The message that precedes the costliest incidents is always the same, and it was on the screen: Plan: 3 to add, 1 to change, 1 to destroy. The resource being destroyed was the production database, and the plan said so, in plain text, fifteen lines earlier. Nobody read it. Not out of carelessness: the output was four hundred lines long, the previous twenty applies had destroyed nothing, and everyone had gotten into the habit of scrolling straight to the confirmation prompt.
A Terraform plan is the only artifact in the entire chain where a mistake still costs nothing. After apply, a deleted database can be restored from a backup, at best with some data loss and a service interruption. Knowing how to read a plan is therefore not a nice-to-have skill; it is the tool's main defensive skill. This lesson teaches you to decode the symbols, to spot destructive replacements in seconds even in a long output, and to take review out of the realm of individual goodwill and put it into a continuous integration pipeline.
The Symbols
Terraform lists its symbols at the top of the output, but only five really matter.
Comments
Comments are powered by GitHub Discussions
Sign in with GitHub to join the discussion