refresh
Terraform asking each provider what the resources recorded in state really look like now, before it plans.
In more detail
Plan, apply and destroy all refresh first, so they compare against reality rather than Terraform's memory. Refreshing is how drift is detected. To only update state from reality without proposing changes, use a refresh-only plan.
Related terms
- Terraform state — Terraform's record, usually a JSON file called terraform.tfstate, mapping each resource in the configuration to the real object it created.
- configuration drift — The slow, unrecorded way machines end up with different versions and settings from each other.
- refresh-only plan — A Terraform plan mode that reads the real resources and shows how they differ from state, without proposing to change them.
- terraform plan — The command that compares configuration, state and reality and prints the actions needed to make them match, without changing anything.
Taught in
- Continuous IaC Drift Detection & State Protection — Cloud Security & DevSecOps Engineering
- Predicting Changes, Then Applying Them — Infrastructure as Code with Terraform
- Tearing It Down With Destroy — Infrastructure as Code with Terraform
- Querying Existing Infrastructure With Data Sources — Infrastructure as Code with Terraform
- What State Really Is And Why It Is Needed — Infrastructure as Code with Terraform
- Simulating A Managed Database — Infrastructure as Code with Terraform
- Detecting And Fixing Configuration Drift — Infrastructure as Code with Terraform
- Importing Existing Resources — Infrastructure as Code with Terraform
- Forcing Replacement — Infrastructure as Code with Terraform
- The Plan That Wanted To Destroy Production — HashiCorp Terraform Associate (004) Exam Prep
- One Hour, No Weights Published — HashiCorp Terraform Associate (004) Exam Prep
- Infrastructure As Code, And One Workflow For Every Platform — HashiCorp Terraform Associate (004) Exam Prep
- State: Terraform's Memory Of What It Built — HashiCorp Terraform Associate (004) Exam Prep
- Reading A Plan, Saving It, Applying It — HashiCorp Terraform Associate (004) Exam Prep
- Validate, Format, Destroy, And The Flags That Bend A Plan — HashiCorp Terraform Associate (004) Exam Prep
- Resources, Data Sources And The References Between Them — HashiCorp Terraform Associate (004) Exam Prep
- Count, For Each And Dynamic Blocks — HashiCorp Terraform Associate (004) Exam Prep