You've used Terraform to deploy a virtual machine and a database. You want to replace this virtual machine instance with an identical one without affecting the database. What is the best way to achieve this using Terraform?
A.
Use the terraform state rm command to remove the VM from state file
B.
Use the terraform taint command targeting the VMs then run terraform plan and terraform apply
C.
Use the terraform apply command targeting the VM resources only
D.
Delete the Terraform VM resources from your Terraform code then run terraform plan and terraform apply
terraform apply -target - just looks at applying part of the config.
In this case we'd need to taint the resource and then run an apply. Just to note taint is now deprecated - seems like it comes up in the exam mind, instead of using taint you should use terrform apply -replace=aws_instance.my_server
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
KJ_Rollings
Highly Voted 7 months, 2 weeks agokeiffo2
Highly Voted 1 year, 3 months agoSpandrop
1 month, 2 weeks agokeiffo2
1 year, 3 months agoalirasouli
1 year agojunk4share
Most Recent 5 months, 2 weeks agoadouban
1 year agodepal_dhir
1 year, 3 months ago