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

Questions 21

You can install community and partner plugins using terraform init.

Options:
A.

True

B.

False

HashiCorp Terraform-Associate-004 Premium Access
Questions 22

As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?

Options:
A.

terraform refresh -upgrade

B.

terraform apply -upgrade

C.

terraform init -upgrade

D.

terraform providers -upgrade

Questions 23

When does Terraform create the .terraform.lock.hc1 file?

Options:
A.

After your first terraform plan

B.

After your first terraform apply

C.

After your first terraform init

D.

When you enable state locking

Questions 24

What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?

Options:
A.

Terraform plan –refresh-only

B.

Terraform show –json

C.

Terraform apply –lock-false

D.

Terraform plan target-state

Questions 25

Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?

Options:
A.

They can securely store cloud credentials.

B.

They have role-based access controls.

C.

Plans and applies can be triggered via version control system integrations.

D.

You must use the CLI to switch between workspaces.

Questions 26

Exhibit:

data " aws_ami " " web " {

most_recent = true

owners = [ " self " ]

tags = {

Name = " web-server "

}

}

A data source is shown in the exhibit. How do you reference the id attribute of this data source?

Options:
A.

aws_ami.web.id

B.

web.id

C.

data.aws_ami.web.id

D.

data.web.id

Questions 27

All standard backend types support state locking, and remote operations like plan, apply, and destroy.

Options:
A.

True

B.

False

Questions 28

You use a cloud provider account that is shared with other team members. You previously used Terraform to create a load balancer that listens on port 80. After application changes, you updated the Terraform code to change the port to 443.

You run terraform plan and see that the execution plan shows the port changing from 80 to 443 like you intended and step away to grab some coffee.

In the meantime, another team member manually changes the load balancer port to 443 through the cloud provider console before you get back to your desk.

What will happen when you run terraform apply upon returning to your desk?

Options:
A.

Terraform will recreate the load balancer.

B.

Terraform will fail with an error because the state file is no longer accurate.

C.

Terraform will change the load balancer port to 80, and then change it back to 443.

D.

Terraform will not make any changes to the load balancer and will update the state file to reflect the manual change.

Questions 29

Exhibit:

module " web_stack " {

source = " ./modules/web_stack "

}

Your configuration defines the module block shown in the exhibit. The web_stack module accepts an input variable named servers. Which of the following changes to the module block sets the servers variable to the value of 3?

Options:
A.

module " web_stack " {source = " ./modules/web_stack " var.servers = 3}

B.

module " web_stack " {source = " ./modules/web_stack " inputs = { servers = 3 }}

C.

module " web_stack " {source = " ./modules/web_stack " servers = 3}

D.

module " web_stack " {source = " ./modules/web_stack " inputs.servers = 3}

Questions 30

You provisioned virtual machines (VMs) on Google Cloud Platform using the gcloud command-line tool.

What must be done to manage these VMs using Terraform instead? Pick the two correct responses.

Options:
A.

Pick the two correct responses below.

B.

Run terraform state pull.

C.

Add an import block to the configuration.

D.

Add a resource block for the existing VM.

E.

Run terraform apply -refresh-only.