TERRAFORM-ASSOCIATE-003 practice question 22 of 30

[Interact with Terraform Modules] 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?

Full set: 226 questions
Answer options
A: Terraform plan rm:aws_instance.ubuntu [1]
B: Terraform state rm:aws_instance.ubuntu [1]
C: Terraform apply rm:aws_instance.ubuntu [1]
D: Terraform destory rm:aws_instance.ubuntu [1]
Correct Answer:
TERRAFORM STATE RM
Explanation

Removing the resource’s address from the state file tells Terraform to “forget” that object, so later plans will ignore it rather than destroy it. The “terraform state rm

” command performs exactly this function; it detaches the specified resource (e.g., awsinstance.ubuntu[1]) from state management while leaving it running in the provider.

References

1. HashiCorp Terraform CLI Command docs – “terraform state rm”

Purpose paragraph

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

2. HashiCorp Terraform Language Guides – State Management

section “Removing items from the state”

developer.hashicorp.com/terraform/language/state/manage#removing-items-from-the-state

Scroll to Top