DELAPARRA
Index
Color
NL
Category: Terraform

refresh

Explained by Updated

What is refresh?

refresh: Updates state to match real infrastructure without changing anything. Now folded into plan/apply by default. Refreshing in Terraform updates the state file to match the real infrastructure, without changing the infrastructure itself. It reads the current settings of every managed resource from the provider. Plans and applies now refresh automatically, so the separate terraform refresh command is deprecated. terraform plan -refresh-only shows what changed outside Terraform, and terraform apply -refresh-only accepts those changes into the state.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about refresh

What should you keep in mind with refresh?

This is how you deal with drift. If someone changed a setting by hand, a refresh-only plan shows it clearly. Then you decide whether to update your code to match reality, or run a normal apply to change the resource back. On large projects, refreshing takes time; -refresh=false skips it, but only use that when you are sure nothing changed.

What does an example of refresh look like?

terraform plan -refresh-only

At a glance

CategoryTerraform
Explained by
Updated

More Terraform terms

All terms starting with R

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.