Summer Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70track

Free HashiCorp Terraform-Associate-004 Practice Exam with Questions & Answers | Set: 4

Questions 31

You’ve enabled DEBUG-level logging for Terraform, and you’d like to send the log data to a file. Which action should you take?

Options:
A.

Set the TF_LOG_PATH environment variable.

B.

Update the Terraform CLI configuration file.

C.

Add a path argument to the terraform block.

D.

Run the terraform output command.

HashiCorp Terraform-Associate-004 Premium Access
Questions 32

Which command doesnotcause Terraform to refresh its state?

Options:
A.

terraform state list

B.

terraform plan

C.

terraform apply

D.

terraform destroy

Questions 33

What is the workflow for deploying new infrastructure with Terraform?

Options:
A.

Write Terraform configuration, run terraform init to initialize the working directory orworkspace, and run terraform apply

B.

Write Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure

C.

Write Terraform configuration, run terraform apply to create infrastructure, use terraform validate to confirm Terraform deployed resources correctly

D.

Write Terraform configuration, run terraform plan to initialize the working directory or workspace, and terraform apply to create the infrastructure

Questions 34

What is a key benefit of the Terraform state file?

Options:
A.

A state file can schedule recurring infrastructure tasks

B.

A state file is a source of truth for resources provisioned with Terraform

C.

A state file is a source of truth for resources provisioned with a public cloud console

D.

A state file is the desired state expressed by the Terraform code files

Questions 35

Terraform installs its providers during which phase?

Options:
A.

Plan

B.

Init

C.

Refresh

D.

All of the above

Questions 36

Which of the following is availableonlyinHCP Terraform workspacesandnot in Terraform CLI?

Options:
A.

Dry runs with terraform plan.

B.

Secure variable storage.

C.

Using one workspace ' s state as a data source for another.

D.

Support for multiple cloud providers.

Questions 37

Exhibit:

resource " azurerm_linux_web_app " " app " {

name = " example-app "

resource_group_name = azurerm_resource_group.rg.name

location = azurerm_resource_group.rg.location

service_plan_id = azurerm_service_plan.plan.id

identity {

type = " UserAssigned "

identity_ids = [azurerm_user_assigned_identity.app.id]

}

}

resource " azurerm_role_assignment " " kv_access " {

scope = azurerm_key_vault.kv.id

role_definition_name = " Key Vault Secrets User "

principal_id = azurerm_user_assigned_identity.app.principal_id

}

Two resource blocks are shown: azurerm_linux_web_app and azurerm_role_assignment. When provisioned, the web app will use the role assignment during creation, so the role assignment must be created first. How do you ensure the azurerm_role_assignment resource is created first?

Options:
A.

Add a depends_on argument to the azurerm_linux_web_app.

B.

Add a create_before_destroy argument to the azurerm_role_assignment.

C.

Change the order of the azurerm_linux_web_app and azurerm_role_assignment blocks.

D.

Add a count argument to both resources.

Questions 38

Which option cannot be used to keep secrets out of Terraform configuration files?

Options:
A.

A Terraform provider

B.

Environment variables

C.

A -var flag

D.

secure string

Questions 39

What does Terraform use the .terraform.lock.hc1 file for?

Options:
A.

There is no such file

B.

Tracking specific provider dependencies

C.

Preventing Terraform runs from occurring

D.

Storing references to workspaces which are locked

Questions 40

Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?

Options:
A.

Terraform state show ‘ provider_type_name

B.

Terraform state list

C.

Terraform get provider_type_name

D.

Terraform state list provider_type_name