Terraform-Associate HashiCorp Certified: Terraform Associate

Loading demo links...

Showing 4–6 of 10 questions

Question 4

You have used Terraform to create an ephemeral development environment in the cloud and are now ready to destroy all the infrastructure described by your Terraform configuration. To be safe, you would like to first see all the infrastructure that will be deleted by Terraform.

Which command should you use to show all of the resources that will be deleted? (Choose two.)

Select all that apply, then click Submit answer.

  • Run terraform plan -destroy.

  • This is not possible. You can only show resources that will be created.

  • Run terraform state rm *.

  • Run terraform destroy and it will first output all the resources that will be deleted before prompting for approval.

Question 5

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.)

Select all that apply, then click Submit answer.

  • Provision new VMs using Terraform with the same VM names

  • Use the terraform import command for the existing VMs

  • Write Terraform configuration for the existing VMs

  • Run the terraform import-gcp command

Question 6

You have a simple Terraform configuration containing one virtual machine (VM) in a cloud provider. You run terraform apply and the VM is created successfully.

What will happen if you delete the VM using the cloud provider console, and run terraform apply again without changing any Terraform code?

Select an option, then click Submit answer.

  • Terraform will remove the VM from state file

  • Terraform will report an error

  • Terraform will not make any changes

  • Terraform will recreate the VM