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

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

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 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Eltooth
Highly Voted 2 years, 5 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 13 times
...
Tyler2023
Most Recent 1 year 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 2 times
...
Ni33
1 year, 6 months ago
Selected Answer: B
BBBBBBBBBBB
upvoted 1 times
...
camps
1 year, 8 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
1 year, 8 months ago
B is correct. terraform state rm
upvoted 1 times
...
eduvar4
2 years, 2 months ago
Selected Answer: B
https://developer.hashicorp.com/terraform/cli/commands/state/rm
upvoted 1 times
...
habbypat123
2 years, 5 months ago
The answer is B for sure
upvoted 2 times
...
Zam88
2 years, 5 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 ...