ExamGecko
Question list
Search
Search

Question 11 - Terraform Associate 003 discussion

Report
Export

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?

A.
Terraform plan rm:aws_instance.ubuntu[1]
Answers
A.
Terraform plan rm:aws_instance.ubuntu[1]
B.
Terraform state rm:aws_instance.ubuntu[1]
Answers
B.
Terraform state rm:aws_instance.ubuntu[1]
C.
Terraform apply rm:aws_instance.ubuntu[1]
Answers
C.
Terraform apply rm:aws_instance.ubuntu[1]
D.
Terraform destory rm:aws_instance.ubuntu[1]
Answers
D.
Terraform destory rm:aws_instance.ubuntu[1]
Suggested answer: B

Explanation:

To tell Terraform to stop managing a specific resource without destroying it, you can use theterraform state rmcommand. 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 useterraform importto start managing it again in a different configuration or workspace. The syntax for this command isterraform state rm , whereis 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 theaws_instanceresource namedubuntufrom the state.Reference= :Command: state rm:Moving Resources

asked 18/09/2024
dennis schouwenaars
35 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first