Free Terraform-Associate-003 Exam Braindumps (page: 2)

Page 2 of 45

A developer accidentally launched a VM (virtual machine) outside of the Terraform workflow and ended up with two servers with the same name. They don't know which VM Terraform manages but do have a list of all active VM IDs.
Which of the following methods could you use to discover which instance Terraform manages?

  1. Run terraform state list to find the names of all VMs, then run terraform state show for each of them to find which VM ID Terraform manages
  2. Update the code to include outputs for the ID of all VMs, then run terraform plan to view the outputs
  3. Run terraform taint/code on all the VMs to recreate them
  4. Use terraform refresh/code to find out which IDs are already part of state

Answer(s): A

Explanation:

The terraform state list command lists all resources that are managed by Terraform in the current state file. The terraform state show command shows the attributes of a single resource in the state file. By using these two commands, you can compare the VM IDs in your list with the ones in the state file and identify which one is managed by Terraform.



When does Sentinel enforce policy logic during a Terraform Cloud run?

  1. Before the plan phase
  2. During the plan phase
  3. Before the apply phase
  4. After the apply phase

Answer(s): C

Explanation:

Sentinel policies are checked after the plan stage of a Terraform run, but before it can be confirmed or the terraform apply is executed. This allows you to enforce rules on your infrastructure before it is created or modified.



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.

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

Answer(s): B,C

Explanation:

To import existing resources into Terraform, you need to do two things1:
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.



Which of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.

  1. Lets you version, reuse, and share infrastructure configuration
  2. Provisions the same resources at a lower cost
  3. Secures your credentials
  4. Reduces risk of operator error
  5. Prevents manual modifications to your resources

Answer(s): A,D

Explanation:

It lets you version, reuse, and share infrastructure configuration as code files, which can be stored in a source control system and integrated with your CI/CD pipeline. It reduces risk of operator error by automating repetitive tasks and ensuring consistency across environments. IaC does not necessarily provision resources at a lower cost, secure your credentials, or prevent manual modifications to your resources - these depend on other factors such as your cloud provider, your security practices, and your access policies.



Page 2 of 45



Post your Comments and Discuss HashiCorp Terraform-Associate-003 exam with other Community members:

Marc commented on October 18, 2024
What the best way to learn terraform?
UNITED STATES
upvote

Chandra commented on October 09, 2024
This is the best and only way of passing this exam as it is extremely hard. Good questions and valid dump.
INDIA
upvote

Madhan commented on September 26, 2024
Useful questions
INDIA
upvote

Abu commented on September 22, 2024
I did not know these questions were available online. I did not believe and trust them and studied quite a lot and just used these questions for practice. But most of the questions turned out to be in the exam.
UNITED STATES
upvote

Sahin commented on July 04, 2024
Need que to learn new things
UNITED STATES
upvote