Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate 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?

Show Answer
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

1 comment
Sign in to comment
Ramdi1Option: C
Nov 25, 2024

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