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

HashiCorp Terraform-Associate-004 - HashiCorp Certified: Terraform Associate (004) (HCTA0-004)

Page: 6 / 10
Total 318 questions

Running terraform fmt without any flags in a directory with Terraform configuration files will check the formatting of those files, but will never change their contents.

A.

True

B.

False

You can define multiple backend blocks in your Terraform configuration to store your state in multiple locations.

A.

True

B.

False

A developer launched a VM outside of the Terraform workflow and ended up with two servers with the same name. They are unsure which VM is managed with Terraform, but they do have a list of all active VM IDs. Which method could you use to determine which instance Terraform manages?

A.

Modify the Terraform configuration to add an import block for both of the virtual machines.

B.

Run a terraform apply -refresh to identify the virtual machine IDs that are already managed by Terraform.

C.

Run terraform state rm on both VMs, then terraform apply to recreate the correct one.

D.

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.

Which task does terraform init not perform?

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

What feature stops multiple users from operating on the Terraform state at the same time?

A.

State locking

B.

Version control

C.

Provider constraints

D.

Remote backends

Which argument can you set on a module block to prevent Terraform from updating the module’s configuration during an init or get operation?

A.

version

B.

lifecycle

C.

count

D.

source

You need to destroy all of the resources in your Terraform workspace, except for aws_instance.ubuntu[1], which you want to keep. How can you tell Terraform to stop managing that specific resource without destroying it?

A.

Remove the resource block from your configuration.

B.

Change the value of the count argument on the resource.

C.

Run terraform state rm aws_instance.ubuntu[1].

D.

Use a moved block.

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

A.

terraform state list ‘provider_type.name’

B.

terraform state show ‘provider_type.name’

C.

terraform get ‘provider_type.name’

D.

terraform state list

Which of the following is not a valid string function in Terraform?

A.

chomp

B.

join

C.

slice

D.

split

Why would you use the -replace flag for terraform apply?

A.

You want to force Terraform to destroy a resource on the next apply.

B.

You want Terraform to ignore a resource on the next apply.

C.

You want to force Terraform to destroy and recreate a resource on the next apply.

D.

You want Terraform to destroy all the infrastructure in your workspace.