What command should...
 
Notifications
Clear all

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

1 Posts
1 Users
0 Likes
124 Views
(@tivisantwan)
Posts: 716
Noble Member
Topic starter
 

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

Suggested Answer: B

Explanation:

"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
 
Posted : 25/12/2022 3:03 pm

Latest TA-002-P V1 Dumps Valid Version

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Share: