Free Terraform-Associate-003 Actual Exam Questions - Question 7 Discussion
terraform validate confirms that your infrastructure matches the Terraform state file.
B vs A? I’d say B again because validate’s main job is to catch errors in your config files before you try to apply anything. It doesn’t compare what’s in your state file or the live setup. That kind of checking happens when you do plan or apply, not during validate. So it seems like it won’t confirm if infra matches state at all.
B imo, validate is about making sure your Terraform files are syntactically correct and logically consistent within themselves. It doesn’t look at the state file or check if your real infrastructure matches the state. That kind of verification happens with commands like terraform plan or terraform apply, not validate.
It’s B because validate won’t check your state file or actual infra, just config syntax.
Isn’t terraform validate just checking the config files, not the state?