Pass the HashiCorp Terraform Associate Terraform-Associate-003 Questions and answers with CertsForce

Viewing page 2 out of 7 pages
Viewing questions 11-20 out of questions
Questions # 11:

Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?

Options:

A.

terraform fmt -write-false


B.

terraform fmt -list -recursive


C.

terraform fmt -check -recursive


D.

terraform fmt -check


Expert Solution
Questions # 12:

Which of the following is not a way to trigger terraform destroy?

Options:

A.

Using the destroy command with auto-approve.


B.

Passing --destroy at the end of a plan request.


C.

Running terraform destroy from the correct directory and then typing yes when prompted in the CLI.


Expert Solution
Questions # 13:

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.


Expert Solution
Questions # 14:

A Terraform backend determines how Terraform loads state and stores updates when you execute which command?

Options:

A.

apply


B.

destroy


C.

Both of these are correct.


D.

Neither of these are correct.


Expert Solution
Questions # 15:

Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.

Options:

A.

True


B.

False


Expert Solution
Questions # 16:

You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?

Options:

A.

Run terraform refresh.


B.

Run terraform init -upgrade.


C.

Run terraform apply -upgrade.


D.

Upgrade your version of Terraform.


Expert Solution
Questions # 17:

Which task does terraform init not perform?

Options:

A.

Validates all required variables are present


B.

Sources any modules and copies the configuration locally


C.

Connects to the backend


D.

Sources all providers used in the configuration and downloads them


Expert Solution
Questions # 18:

Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state files. How can you protect that data?

Options:

A.

Edit your state file to scrub out the sensitive data


B.

Always store your secrets in a secrets.tfvars file


C.

Delete the state file every time you run Terraform


D.

Store the state in an encrypted backend


Expert Solution
Questions # 19:

You've used Terraform to deploy a virtual machine and a database. You want to replace this virtual machine instance with an identical one without affecting the database. What is the best way to achieve this using Terraform?

Options:

A.

Use the terraform state rm command to remove the VM from state file


B.

Use the terraform taint command targeting the VMs then run terraform plan and terraform apply


C.

Use the terraform apply command targeting the VM resources only


D.

Delete the Terraform VM resources from your Terraform code then run terraform plan and terraform apply


Expert Solution
Questions # 20:

When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)

Options:

A.

When you change a Terraform-managed resource via the Azure Cloud Console, Terraform updates the state file to reflect the change during the next plan or apply


B.

Changing resources via the Azure Cloud Console records the change in the current state file


C.

When you change a resource via the Azure Cloud Console, Terraform records the changes in a new state file


D.

Changing resources via the Azure Cloud Console does not update current state file


Expert Solution
Viewing page 2 out of 7 pages
Viewing questions 11-20 out of questions