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

Exhibit:

provider " aws " { region = " us-east-1 " }

provider " aws " { region = " us-west-2 " }

You need to deploy resources into two different AWS regions in the same Terraform configuration using the provider blocks shown in the exhibit. What do you need to add to the provider configuration to deploy a resource to the us-west-2 AWS region?

Options:
A.

Add an alias to the us-west-2 provider (for example, alias = " west " ) and set provider = aws.west on resources that should use us-west-2.

B.

Rename the provider block to provider " aws " " west " { region = " us-west-2 " }.

C.

Create a new provider named provider " aws_west " { region = " us-west-2 " }.

D.

Nothing. Terraform will automatically decide which provider to use for each resource.

HashiCorp Terraform-Associate-004 Premium Access
Questions 32

Which of the following is not a benefit of adopting infrastructure as code?

Options:
A.

Versioning

B.

A Graphical User Interface

C.

Reusability of code

D.

Automation

Questions 33

A module can always refer to all variables declared in its parent module.

Options:
A.

True

B.

False

Questions 34

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 35

Which of the following isnotan advantage of using Infrastructure as Code (IaC) operations?

Options:
A.

Self-service infrastructure deployment.

B.

Modify a count parameter to scale resources.

C.

API-driven workflows.

D.

Troubleshoot via a Linux diff command.

E.

Public cloud console configuration workflows.

Questions 36

You have two separate Terraform configurations:

Configuration A provisions a virtual network and subnets.

Configuration B provisions compute resources that must be attached to those subnets.

In Configuration B, you have a terraform_remote_state data source configured to read Configuration A’s local state file. When running terraform plan for Configuration B in a CI/CD pipeline, Terraform fails because the state file cannot be found and is not accessible to the pipeline runtime.

What is the best solution to reliably access the state data from Configuration A in this scenario?

Options:
A.

Switch to input variables in Configuration B and supply the values using a terraform.tfvars file.

B.

Change the path argument to use an absolute filesystem path so Terraform can always locate the local state file.

C.

Migrate Configuration A to a remote backend and update the terraform_remote_state data source in Configuration B to reference that remote backend.

D.

Combine the two configurations into a single configuration and use local references.

Questions 37

You can configure multiple cloud blocks in your Terraform configuration to connect your workspace to both HCP Terraform and your Terraform Enterprise instance.

Options:
A.

True

B.

False

Questions 38

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

Options:
A.

With two spaces.

B.

With four spaces.

C.

With three spaces.

D.

With a tab.

Questions 39

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

Questions 40

Which backend does the Terraform CLI use by default?

Options:
A.

Depends on the cloud provider configured

B.

HTTP

C.

Remote

D.

Terraform Cloud

E.

Local