Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 24 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 24
Topic #: 1
[All Terraform Associate Questions]

Why would you use the terraform taint command?

  • A. When you want to force Terraform to destroy a resource on the next apply
  • B. When you want to force Terraform to destroy and recreate a resource on the next apply
  • C. When you want Terraform to ignore a resource on the next apply
  • D. When you want Terraform to destroy all the infrastructure in your workspace
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Eltooth
Highly Voted 2 years, 4 months ago
Selected Answer: B
Noe of the answers really explain what taint command does - except B is closest. "The terraform taint command informs Terraform that a particular object has become degraded or damaged. Terraform represents this by marking the object as "tainted" in the Terraform state, and Terraform will propose to replace it in the next plan you create." https://www.terraform.io/cli/commands/taint
upvoted 10 times
...
Alandt
Highly Voted 10 months ago
Selected Answer: B
IMPORTANT NOTE: taint command is deprecated. For Terraform v0.15.2 and later, Hashicorp recommends using the -replace option with terraform apply instead
upvoted 5 times
...
Jerry_m10
Most Recent 1 year ago
Outdated question for v3.0.0 test. Although B is correct, but we now have terraform -replace="resource_name" for this now.
upvoted 2 times
...
Halimb
1 year, 2 months ago
Selected Answer: B
Although B is correct here, the question is old and the command is deprecated. Instead use terraform apply -replace="<resource_to_replace>". See https://developer.hashicorp.com/terraform/cli/commands/taint
upvoted 2 times
...
karendavtyan
1 year, 6 months ago
Selected Answer: B
B. When you want to force Terraform to destroy and recreate a resource on the next apply
upvoted 1 times
...
Ni33
1 year, 6 months ago
Selected Answer: B
B is correct
upvoted 1 times
...
Power123
1 year, 7 months ago
This command is now deprecated and suggested option is now terraform apply -replace="state_object" . Ans B
upvoted 4 times
...
Bilalglg93350
1 year, 8 months ago
The correct answer is C. When you want Terraform to ignore a resource on the next apply. The terraform taint command is used to mark a resource managed by Terraform as "tainted," which means that it needs to be recreated on the next apply. This is useful when a resource is in an inconsistent state or needs to be recreated for some other reason. However, the taint command does not destroy or force Terraform to destroy a resource on the next apply (option A and B). Instead, it marks the resource as tainted, indicating that it needs to be recreated. When you run terraform apply after marking a resource as tainted, Terraform will destroy and recreate the resource. Option D is incorrect because the terraform taint command only marks a single resource as tainted and does not destroy all the infrastructure in your workspace.
upvoted 1 times
...
SilentMilli
1 year, 9 months ago
Selected Answer: B
The "terraform taint" command is used to mark a resource as "tainted," indicating to Terraform that the resource should be destroyed and recreated on the next "terraform apply" command. This can be useful in cases where you need to make changes to a resource that cannot be updated in place, or if you want to enforce a clean rebuild of a resource for some other reason. It's important to note that tainting a resource will not immediately destroy the resource, but will instead cause Terraform to plan to destroy and recreate the resource on the next "terraform apply" command. This allows you to review and confirm the changes that Terraform will make before actually applying them.
upvoted 2 times
...
BlackZeros
2 years, 5 months ago
Selected Answer: B
b it is
upvoted 3 times
...
javibadillo
2 years, 5 months ago
Selected Answer: B
https://www.terraform.io/cli/commands/taint#recommended-alternative
upvoted 3 times
...
softarts
2 years, 6 months ago
it is B
upvoted 4 times
...
d0ug7979
2 years, 6 months ago
This command is now deprecated since v0.15.2 and suggested option is now terraform apply -replace="state_object" https://www.terraform.io/cli/commands/taint#recommended-alternative
upvoted 3 times
biscuithammer
2 years, 6 months ago
yes but on the exam it's still a valid answer
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...