Free Terraform Associate Exam Braindumps (page: 20)

Page 19 of 113

You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (files). You need to enable debug messages to find this out.
Which of the following would achieve this?

  1. Set the environment variable TF_LOG=TRACE
  2. Set verbose logging for each provider in your Terraform configuration
  3. Set the environment variable TF_VAR_log=TRACE
  4. Set the environment variable TF_LOG_PATH

Answer(s): A

Explanation:

Although this will only output to stderr and if you need to review log file you will need to include TF_LOG_PATH=pathtofile


Reference:

https://www.terraform.io/internals/debugging



How is terraform import run?

  1. As a part of terraform init
  2. As a part of terraform plan
  3. As a part of terraform refresh
  4. By an explicit call
  5. All of the above

Answer(s): D

Explanation:

"The current implementation of Terraform import can only import resources into the state. It does not generate configuration. A future version of Terraform will also generate configuration. Because of this, prior to running terraform import it is necessary to write manually a resource configuration block for the resource, to which the imported object will be mapped. While this may seem tedious, it still gives Terraform users an avenue for importing existing resources."


Reference:

https://www.terraform.io/cli/import/usage



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?

  1. Terraform will remove the VM from state file
  2. Terraform will report an error
  3. Terraform will not make any changes
  4. Terraform will recreate the VM

Answer(s): D



Which of these options is the most secure place to store secrets foe connecting to a Terraform remote backend?

  1. Defined in Environment variables
  2. Inside the backend block within the Terraform configuration
  3. Defined in a connection configuration outside of Terraform
  4. None of above

Answer(s): A

Explanation:

Warning: We recommend using environment variables to supply credentials and other sensitive data. If you use -backend-config or hardcode these values directly in your configuration, Terraform will include these values in both the .terraform subdirectory and in plan files. This can leak sensitive credentials.


Reference:

https://www.terraform.io/language/settings/backends/configuration#credentials-and-sensitive-data






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

Terraform Associate Discussions & Posts