Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 219


Using the terraform state rm command against a resource will destroy it.

Show Answer
Correct Answer: AB

The terraform state rm command removes a resource's entry from the Terraform state file, meaning Terraform will no longer manage or track that resource. However, the resource itself will still exist in your infrastructure. This does not destroy the actual resource; it simply stops Terraform from knowing about it. To destroy the resource, you should use the terraform destroy command or modify your configuration to remove the resource and run terraform apply.

Discussion

8 comments
Sign in to comment
campsOption: B
Apr 1, 2023

B. False Using the terraform state rm command does not destroy the actual resource. Instead, it removes the resource's entry from the Terraform state file. As a result, Terraform will no longer manage or track the resource. However, the resource itself will still exist in your infrastructure. If you want to destroy the resource, you should use the terraform destroy command or modify your configuration to remove the resource and run terraform apply.

333e1abOption: B
Jun 24, 2024

How does examTopics evaluate correct answers?

SilentMilliOption: B
Mar 28, 2023

The terraform state rm command removes a resource from the Terraform state file without destroying the actual resource in your infrastructure. This command is typically used when you want to delete a resource that was not created using Terraform, or when you want to remove a resource from the Terraform state file for some other reason, such as to re-create the resource using a different configuration.

micropbl4Option: B
Mar 29, 2023

Command just remove it from the state file, but didn't touch existing resources

bugalterOption: B
Apr 11, 2023

B. False

AlenKumarOption: B
Apr 19, 2023

Answer: B

FarziWaliMarziOption: B
Apr 22, 2023

will update state file only

TlakminiOption: B
Aug 17, 2023

it will update state file only