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.
More on Workflow and CLI
What does `terraform init` do?BeginnerWhat does `terraform plan` do?BeginnerWhat does `terraform apply` do and what is `-auto-approve`?BeginnerWhat does `terraform destroy` do?BeginnerWhat do `terraform fmt` and `terraform validate` check?BeginnerWhy save a plan with `-out` and apply that file?Intermediate