Command
terraform refresh
Explanation
Updates the Terraform state file with the latest resource values from the real infrastructure. Useful to detect drift.
Examples
Refresh a specific resource
terraform refresh -target=aws_instance.my_instance
terraform refresh
Updates the Terraform state file with the latest resource values from the real infrastructure. Useful to detect drift.
Refresh a specific resource
terraform refresh -target=aws_instance.my_instance