Introduction
Sometimes you want to force Terraform to destroy and recreate a specific resource without changing the rest of your infrastructure. The -replace flag helps you do exactly that during the apply step.
When a resource is stuck in a bad state and you want to recreate it without affecting others.
When you want to update a resource that requires replacement but don't want to change your whole plan.
When debugging infrastructure issues by recreating a single resource.
When a resource's configuration changed outside Terraform and you want to sync by recreating it.
When you want to test changes on a resource by forcing its replacement safely.