What is the difference between `terraform validate` and `terraform plan`?
BeginnerConceptWorkflow and CLI
Answer
validate is static and offline: syntax, argument names, type consistency. plan talks to the provider and cloud, reads state and finds problems validate cannot, such as a nonexistent AMI, expired credentials or an invalid CIDR. Run validate on every commit for fast feedback and plan on pull requests.
More on Workflow and CLI
What does `terraform init` do?BeginnerWhat does `terraform plan` do?BeginnerWhat does `terraform apply` do and what is `-auto-approve`?BeginnerWhat does `terraform destroy` do?BeginnerWhat do `terraform fmt` and `terraform validate` check?BeginnerWhy save a plan with `-out` and apply that file?Intermediate