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

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam Terraform Associate topic 1 question 82 discussion

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

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?

  • A. terraform apply rm aws_instance.ubuntu[1]
  • B. terraform state rm aws_instance.ubuntu[1]
  • C. terraform plan rm aws_instance.ubuntu[1]
  • D. terraform delete aws_instance.ubuntu[1]
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Reference:
https://www.terraform.io/docs/cli/commands/state/rm.html

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Eltooth
Highly Voted 1 year, 9 months ago
Selected Answer: B
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
upvoted 11 times
...
Tyler2023
Most Recent 4 months, 3 weeks ago
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.
upvoted 1 times
...
Ni33
10 months, 3 weeks ago
Selected Answer: B
BBBBBBBBBBB
upvoted 1 times
...
camps
12 months ago
Selected Answer: B
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.
upvoted 3 times
...
Power123
12 months ago
B is correct. terraform state rm
upvoted 1 times
...
eduvar4
1 year, 6 months ago
Selected Answer: B
https://developer.hashicorp.com/terraform/cli/commands/state/rm
upvoted 1 times
...
habbypat123
1 year, 9 months ago
The answer is B for sure
upvoted 2 times
...
Zam88
1 year, 9 months ago
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
upvoted 3 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 ...