You can force a replacement of an AWS EC2 instance within Terraform by issuing the following command. The previous command “taint” has now been deprecated.
terraform apply -replace="aws_instance.My-Instance-1"
Where your instance is called “My-Instance-1” within the Terraform template. When you run this the instance will be destroyed and replaced (as if it was the first time it was deployed).