To bring existing GCP VMs under Terraform management, which action is required?

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

To bring existing GCP VMs under Terraform management, which action is required?

Explanation:
To bring an existing GCP VM under Terraform management, you must map that real resource into Terraform’s state using the import command. Terraform only manages resources that exist in its state, so importing tells Terraform, “this VM already exists and should be tracked under this resource name in your configuration.” After importing, you should have a matching Terraform configuration block (for the VM) so future changes are expressed in code. Importing does not create a new VM, nor does it automatically generate configuration. There is no separate Import-Gcp command—the correct approach is to use the Terraform import command with the appropriate Google Cloud resource type and addresses.

To bring an existing GCP VM under Terraform management, you must map that real resource into Terraform’s state using the import command. Terraform only manages resources that exist in its state, so importing tells Terraform, “this VM already exists and should be tracked under this resource name in your configuration.” After importing, you should have a matching Terraform configuration block (for the VM) so future changes are expressed in code. Importing does not create a new VM, nor does it automatically generate configuration. There is no separate Import-Gcp command—the correct approach is to use the Terraform import command with the appropriate Google Cloud resource type and addresses.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy