nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #89

A developer on your team is going lo leaf down an existing deployment managed by Terraform and deploy a new one. However, there is a server resource named aws instant.ubuntu[l] they would like to keep

The correct answer is B. Terraform state rm:aws_instance.ubuntu[1]. To tell Terraform to stop managing a specific resource without destroying it, you can use the terraform state rm command. This command will remove the resource from the Terraform state, which means that Terraform will no longer track or update the corresponding remote object. How

Submitted by anna_se· Apr 18, 2026Manage Terraform State

Question

A developer on your team is going lo leaf down an existing deployment managed by Terraform and deploy a new one. However, there is a server resource named aws instant.ubuntu[l] they would like to keep. What command should they use to tell Terraform to stop managing that specific resource?

Options

  • ATerraform plan rm:aws_instance.ubuntu[1]
  • BTerraform state rm:aws_instance.ubuntu[1]
  • CTerraform apply rm:aws_instance.ubuntu[1]
  • DTerraform destory rm:aws_instance.ubuntu[1]

How the community answered

(51 responses)
  • A
    2% (1)
  • B
    86% (44)
  • C
    8% (4)
  • D
    4% (2)

Explanation

To tell Terraform to stop managing a specific resource without destroying it, you can use the terraform state rm command. This command will remove the resource from the Terraform state, which means that Terraform will no longer track or update the corresponding remote object. However, the object will still exist in the remote system and you can later use terraform import to start managing it again in a different configuration or workspace. The syntax for this command is terraform state rm <address>, where <address> is the resource address that identifies the resource instance to remove. For example, terraform state rm aws_instance.ubuntu[1] will remove the second instance of the aws_instance resource named ubuntu from the state.

Topics

#Terraform state management#terraform state rm#Resource lifecycle#Terraform CLI

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice