To manage existing virtual machines (VMs) using Terraform after provisioning them via gcloud, which actions are required?

Prepare for your Terraform Associate Exam with our engaging quiz. Test your knowledge with multiple choice questions and receive detailed explanations to enhance your understanding. Ace your exam with confidence!

The correct answer is based on the need to bring existing resources into Terraform's management without recreating them. Using the 'terraform import' command allows Terraform to recognize resources that have already been created outside of Terraform, like those provisioned via gcloud. This command associates the existing virtual machines with Terraform's state, allowing them to be managed alongside new resources created via Terraform configurations.

Writing Terraform configuration for these existing VMs is essential as it defines how Terraform understands these resources, including their properties and relationships. This step ensures that Terraform can manage the lifecycle of the imported VMs properly going forward, including making updates or removals.

The other options suggest methods that either involve deleting resources that are already in use or recreating them manually, which is inefficient and could lead to service disruption. The essence of Terraform's capability lies in its ability to import and manage existing infrastructure, making the correct approach to begin with the import command, followed by the appropriate configuration.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy