Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 82


A fellow developer on your team is asking for some help in refactoring their Terraform code. As part of their application's architecture, they are going to tear down an existing deployment managed by Terraform and deploy new. However, there is a server resource named aws_instance.ubuntu[1] they would like to keep to perform some additional analysis.

What command should be used to tell Terraform to no longer manage the resource?

Show Answer
Correct Answer: B

B

Reference:

https://www.terraform.io/docs/cli/commands/state/rm.html

Discussion

8 comments
Sign in to comment
EltoothOption: B
Jun 28, 2022

B is correct answer : terraform state rm "You can use terraform state rm in the less common situation where you wish to remove a binding to an existing remote object without first destroying it, which will effectively make Terraform "forget" the object while it continues to exist in the remote system." https://www.terraform.io/cli/commands/state/rm

Zam88Option: B
Jun 19, 2022

state rm The terraform state rm command is used to remove items from the Terraform state. This command can remove single resources, single instances of a resource, entire modules, and more B

campsOption: B
Mar 31, 2023

B. terraform state rm aws_instance.ubuntu[1] To tell Terraform to no longer manage a specific resource, you can use the terraform state rm command. This command removes the specified resource from the Terraform state file, effectively telling Terraform that the resource no longer exists.

habbypat123Option: B
Jun 22, 2022

The answer is B for sure

Tyler2023Option: B
Nov 1, 2023

The answer is correct based on this https://developer.hashicorp.com/terraform/cli/commands/state/rm You can use terraform state rm in the less common situation where you wish to remove a binding to an existing remote object without first destroying it, which will effectively make Terraform "forget" the object while it continues to exist in the remote system.

eduvar4Option: B
Sep 27, 2022

https://developer.hashicorp.com/terraform/cli/commands/state/rm

Power123Option: B
Mar 31, 2023

B is correct. terraform state rm

Ni33Option: B
May 9, 2023

BBBBBBBBBBB