Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 295

A developer on your team is going to tear down an existing deployment managed by Terraform and deploy a new one. However, there is a server resource named aws_instance.ubuntu[1] they would like to keep. What command should they use to tell Terraform to stop managing that specific resource?

    Correct Answer: C

    To stop Terraform from managing an existing resource, you should use the `terraform state rm` command. This command removes the specified resource from the Terraform state, effectively causing Terraform to 'forget' about that resource while leaving it intact in your infrastructure.

Discussion
Ramdi1Option: C

The `terraform state rm` command removes bindings from the Terraform state, causing Terraform to "forget about" existing objects.