What exactly happens during `terraform plan`?
AdvancedConceptIaC and Terraform Fundamentals
Answer
Terraform reads state, refreshes each managed resource by calling the provider's read function, then compares the refreshed state with the configuration to propose a diff. Providers validate the config (ValidateResourceConfig) and compute PlanResourceChange, which marks attributes that depend on unknown inputs as "known after apply". The result is a plan graph; nothing is changed remotely.
More on IaC and Terraform Fundamentals
What is Infrastructure as Code and why do teams use it?BeginnerWhat is the difference between declarative and imperative infrastructure tools?BeginnerWhat is Terraform and what problem does it solve?BeginnerWhat is HCL and can Terraform use anything else?BeginnerWhich files make up a typical Terraform root module?BeginnerHow does Terraform work internally?Advanced