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
Question
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)- A13% (4)
- B81% (25)
- D6% (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
Community Discussion
No community discussion yet for this question.