Terraform Associate 003

Terraform Associate 003 practice questions, page 5 of 6, with answer review and explanations.

Question 21

A developer on your team is going to tear down an existing deployment managed by Terraform and deploy a new one. However, there is a server resource named aws_instance.ubuntu[1] they would like to keep. What command should they use to tell Terraform to stop managing that specific resource?

  1. terraform destroy aws_instance.ubuntu[1]
  2. terraform plan rm aws_instance.ubuntu[1]
  3. terraform apply rm aws_instance.ubuntu[1]
  4. terraform state rm aws_instance.ubuntu[1]

Question 22

Which of the following locations can Terraform use as a private source for modules? (Choose two.)

  1. Public repository on GitHub.
  2. Internally hosted VCS (Version Control System) platform.
  3. Public Terraform Registry.
  4. Private repository on GitHub.

Question 23

You are writing Terraform configuration that calls a child module. This child module declares an output value. How can you ensure that Terraform will print out this value when you run Terraform CLI commands such as terraform apply?

  1. Nothing. Terraform will automatically print out all output values from child modules.
  2. Nothing. Terraform cannot use output values from child modules.
  3. Declare a new output in your root configuration that references the module’s output.
  4. None of the above.

Question 24

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

  1. Provision new VMs using Terraform with the same VM names.
  2. Use the terraform import command for the existing VMs.
  3. Write Terraform configuration for the existing VMs.
  4. Run the terraform import-gcp command.

Question 25

Outside of the required_providers block, Terraform configurations always refer to providers by their local names.

  1. True
  2. False