terraform/terraform-refresh

Refresh State

Update state with real infrastructure

terraform
state
refresh

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