Pre-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: 7

Questions 61

Terraform providers are always installed from the Internet.

Options:
A.

True

B.

False

HashiCorp Terraform-Associate-004 Premium Access
Questions 62

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?

Options:
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.

Questions 63

You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into a file called backend.tf.

Which command will migrate your current state file to the new S3 remote backend?

Options:
A.

terraform state

B.

terraform init

C.

terraform push

D.

terraform refresh

Questions 64

What is the Terraform style convention for indenting a nesting level compared to the one above it?

Options:
A.

With a tab

B.

With two spaces

C.

With four spaces

D.

With three spaces

Questions 65

terraform apply is failing with the following error. What next step should you take to determine the root cause of the problem?

Error:

yaml

CopyEdit

Error loading state: AccessDenied: Access Denied

status code: 403, request id: 288766CE5CCA24A0, host id: web.example.com

Options:
A.

Run terraform login to reauthenticate with the provider.

B.

Set TF_LOG=DEBUG.

C.

Review /var/log/terraform.log for error messages.

D.

Review syslog for Terraform error messages.

Questions 66

If a module declares a variable with a default, that variable must also be defined within the module.

Options:
A.

True

B.

False

Questions 67

You want to create a string that is a combination of a generated random_id and a variable, and reuse that string several times in your configuration.

What is the simplest correct way to implement this without repeating the random_id and variable?

Options:
A.

Use a data source.

B.

Use a module.

C.

Add a local value.

D.

Add an output value.

Questions 68

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

Options:
A.

terraform destroy

B.

All of these will trigger terraform destroy

C.

terraform plan -destroy

D.

terraform destroy -auto-approve

Questions 69

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

Options:
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.

Questions 70

You add a new provider to your configuration and immediately run terraform apply in the CD using the local backend. Why does the apply fail?

Options:
A.

The Terraform CD needs you to log into Terraform Cloud first

B.

Terraform requires you to manually run terraform plan first

C.

Terraform needs to install the necessary plugins first

D.

Terraform needs you to format your code according to best practices first