nerdexam
HashiCorpHashiCorp

TA-002-P · Question #118

TA-002-P Question #118: Real Exam Question with Answer & Explanation

The correct answer is C: terraform taint. {"question_number": 2, "question": "Which Terraform command will force a marked resource to be destroyed and recreated on the next apply?", "correct_answer": "C", "explanation": "The terraform taint <resource> command manually marks a resource as 'tainted' in the state file. On t

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

Which Terraform command will force a marked resource to be destroyed and recreated on the next apply?

Options

  • Aterraform fmt
  • Bterraform destroy
  • Cterraform taint
  • Dterraform refresh

Explanation

{"question_number": 2, "question": "Which Terraform command will force a marked resource to be destroyed and recreated on the next apply?", "correct_answer": "C", "explanation": "The terraform taint <resource> command manually marks a resource as 'tainted' in the state file. On the next terraform apply, Terraform will destroy and recreate that resource. This is useful when a resource is in a degraded or unknown state without changing the configuration. terraform fmt (A) only reformats code. terraform destroy (B) destroys all resources, not just one. terraform refresh (D) updates the state file to match real-world infrastructure but does not force recreation. Note: In Terraform v0.15.2+, terraform taint was superseded by terraform apply -replace=<resource>.", "generated_by": "claude-sonnet", "llm_judge_score": 4}

Topics

#Terraform CLI#terraform taint#Resource lifecycle#Force recreation

Community Discussion

No community discussion yet for this question.

Full TA-002-P PracticeBrowse All TA-002-P Questions