Interview Prep/Terraform/Workflow and CLI

What is the difference between `taint` and `-replace`?

IntermediateConceptWorkflow and CLI
Answer

terraform taint marked a resource in state so the next apply recreates it and is deprecated. terraform apply -replace='aws_instance.web' does the same in one step and shows the replacement in the plan before you approve it. Prefer -replace.

All Terraform questions Roadmap: Terraform

More on Workflow and CLI