What is the primary purpose of terraform import?

Prepare for the HashiCorp Terraform Associate Exam. Utilize flashcards and multiple-choice questions with detailed hints and explanations. Boost your confidence and be ready for success!

Multiple Choice

What is the primary purpose of terraform import?

Explanation:
Terraform import is used to bring existing infrastructure under Terraform management by recording it in Terraform’s state. It takes resources that already exist in your cloud or external systems and creates a mapping in the state so Terraform can track and manage their lifecycle going forward. Import does not create new resources; it only associates the real resource with a resource block in your configuration and updates the state with the current attributes. After importing, you typically add a matching resource block in your code and then use plan and apply to manage changes. It isn’t about importing modules, nor about bringing in a new state file or moving state between workspaces.

Terraform import is used to bring existing infrastructure under Terraform management by recording it in Terraform’s state. It takes resources that already exist in your cloud or external systems and creates a mapping in the state so Terraform can track and manage their lifecycle going forward. Import does not create new resources; it only associates the real resource with a resource block in your configuration and updates the state with the current attributes. After importing, you typically add a matching resource block in your code and then use plan and apply to manage changes. It isn’t about importing modules, nor about bringing in a new state file or moving state between workspaces.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy