VAIDATION ANMD PRE AND POST CONDITION KINDA SIMILIAR BUT ACTUALLY NOT
Before plan — Terraform hasn't even started thinking about what to create/change. It just reads your variable value and immediately checks it. No AWS calls, no state file reading, nothing.
you run terraform plan
↓
Terraform reads variables ← validation runs HERE
↓
Terraform reads state + AWS
↓
Terraform figures out what to create/change ← this is "the plan"
During plan — Terraform has already read everything (state file, current AWS resources, all variables). Now it's building the plan and checks precondition at this point — so it has full context of everything.
Terraform reads state + AWS
↓
Terraform figures out what to create/change
↓
precondition runs HERE — checks before actually doing anything
So the real difference in timing: