terraform apply -replace=aws_instance.web

Category: IaC & Automation

terraform apply -replace=aws_instance.web

Force recreation of one resource during apply

Tells Terraform to destroy and recreate the resource at the given address even if nothing else changed. This is the modern replacement for the removed taint command, used when a server is corrupt or its configuration changed underneath you. Apply still plans and asks for approval first. Related: terraform state rm aws_instance.web.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.