nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #110

You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with Terraform and want to manage these VMs using Ter

The correct answer is B. Write Terraform configuration for the existing VMs C. Use the terraform import command for the existing VMs. To import existing resources into Terraform, you need to do two things: - Write a resource configuration block for each resource, matching the type and name used in your state file. - Run terraform import for each resource, specifying its address and ID. There is no such command

Submitted by khalil_dz· Apr 18, 2026Manage Terraform State

Question

You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with Terraform and want to manage these VMs using Terraform instead. What are the two things you must do to achieve this? Choose two correct answers.

Options

  • ARun the terraform Import-gcp command
  • BWrite Terraform configuration for the existing VMs
  • CUse the terraform import command for the existing VMs
  • DProvision new VMs using Terraform with the same VM names

How the community answered

(31 responses)
  • A
    13% (4)
  • B
    81% (25)
  • D
    6% (2)

Explanation

To import existing resources into Terraform, you need to do two things: - Write a resource configuration block for each resource, matching the type and name used in your state file. - Run terraform import for each resource, specifying its address and ID. There is no such command as terraform Import-gcp, and provisioning new VMs with the same names will not import them into Terraform.

Topics

#terraform import#managing existing resources#Terraform configuration#Terraform state

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice