ExamGecko
Home / HashiCorp / Terraform Associate 003 / List of questions
Ask Question

HashiCorp Terraform Associate 003 Practice Test - Questions Answers, Page 12

List of questions

Question 111

Report
Export
Collapse

What is the workflow for deploying new infrastructure with Terraform?

Write Terraform configuration, run terraform init to initialize the working directory or workspace, and run terraform apply
Write Terraform configuration, run terraform init to initialize the working directory or workspace, and run terraform apply
Write Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure
Write Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure
Write Terraform configuration, run terraform apply to create infrastructure, use terraform validate to confirm Terraform deployed resources correctly
Write Terraform configuration, run terraform apply to create infrastructure, use terraform validate to confirm Terraform deployed resources correctly
Write Terraform configuration, run terraform plan to initialize the working directory or workspace, and terraform apply to create the infrastructure
Write Terraform configuration, run terraform plan to initialize the working directory or workspace, and terraform apply to create the infrastructure
Suggested answer: A

Explanation:

This is the workflow for deploying new infrastructure with Terraform, as it will create a plan and apply it to the target environment. The other options are either incorrect or incomplete.

asked 18/09/2024
MIGUEL FERNANDEZ
36 questions

Question 112

Report
Export
Collapse

Select the command that doesn't cause Terraform to refresh its state.

Terraform destroy
Terraform destroy
Terraform apply
Terraform apply
Terraform plan
Terraform plan
Terraform state list
Terraform state list
Suggested answer: D

Explanation:

This is the command that does not cause Terraform to refresh its state, as it only lists the resources that are currently managed by Terraform in the state file. The other commands will refresh the state file before performing their operations, unless you use the-refresh=falseflag.

asked 18/09/2024
Asif Ibrahim
47 questions

Question 113

Report
Export
Collapse

Which command lets you experiment with terraform expressions?

Terraform console
Terraform console
Terraform validate
Terraform validate
Terraform env
Terraform env
Terraform test
Terraform test
Suggested answer: A

Explanation:

This is the command that lets you experiment with Terraform expressions, by providing an interactive console that allows you to evaluate expressions and see their results. You can use this command to test your expressions before using them in your configuration files.

asked 18/09/2024
Ronakkumar Shyani
47 questions

Question 114

Report
Export
Collapse

If a DevOps team adopts AWS CloudFormation as their standardized method for provisioning public cloud resoruces, which of the following scenarios poses a challenge for this team?

The team is asked to manage a new application stack built on AWS-native services
The team is asked to manage a new application stack built on AWS-native services
The organization decides to expand into Azure wishes to deploy new infrastructure
The organization decides to expand into Azure wishes to deploy new infrastructure
The team is asked to build a reusable code based that can deploy resources into any AWS region
The team is asked to build a reusable code based that can deploy resources into any AWS region
The DevOps team is tasked with automating a manual, web console-based provisioning.
The DevOps team is tasked with automating a manual, web console-based provisioning.
Suggested answer: B

Explanation:

This is the scenario that poses a challenge for this team, if they adopt AWS CloudFormation as their standardized method for provisioning public cloud resources, as CloudFormation only supports AWS services and resources, and cannot be used to provision infrastructure on other cloud platforms such as Azure.

asked 18/09/2024
Phil Horikawa
38 questions

Question 115

Report
Export
Collapse

When using a remote backend or terraform Cloud integration, where does Terraform save resource sate?

In an environment variable
In an environment variable
On the disk
On the disk
In the remote backend or Terraform Cloud
In the remote backend or Terraform Cloud
In memory
In memory
Suggested answer: C

Explanation:

This is where Terraform saves resource state when using a remote backend or Terraform Cloud integration, as it allows you to store and manage your state file in a remote location, such as a cloud storage service or Terraform Cloud's servers. This enables collaboration, security, and scalability for your Terraform infrastructure.

asked 18/09/2024
N C
39 questions

Question 116

Report
Export
Collapse

You add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The existing and new resources use the same provider. The working contains a .terraform.lock, hc1 file.

How will Terraform choose which version of the provider to use?

Terraform will use the version recorded in your lock file
Terraform will use the version recorded in your lock file
Terraform will use the latest version of the provider for the new resource and the version recorded in the lock file to manage existing resources
Terraform will use the latest version of the provider for the new resource and the version recorded in the lock file to manage existing resources
Terraform will check your state file to determine the provider version to use
Terraform will check your state file to determine the provider version to use
Terraform will use the latest version of the provider available at the time you provision your new resource
Terraform will use the latest version of the provider available at the time you provision your new resource
Suggested answer: A

Explanation:

This is how Terraform chooses which version of the provider to use, when you add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The lock file records the exact version of each provider that was installed in your working directory, and ensures that Terraform will always use the same provider versions until you runterraform init -upgradeto update them.

asked 18/09/2024
Chris Bezuidenhout
39 questions

Question 117

Report
Export
Collapse

What is a key benefit of the Terraform state file?

A state file can schedule recurring infrastructure tasks
A state file can schedule recurring infrastructure tasks
A state file is a source of truth for resources provisioned with Terraform
A state file is a source of truth for resources provisioned with Terraform
A state file is a source of truth for resources provisioned with a public cloud console
A state file is a source of truth for resources provisioned with a public cloud console
A state file is the desired state expressed by the Terraform code files
A state file is the desired state expressed by the Terraform code files
Suggested answer: B

Explanation:

This is a key benefit of the Terraform state file, as it stores and tracks the metadata and attributes of the resources that are managed by Terraform, and allows Terraform to compare the current state with the desired state expressed by your configuration files.

asked 18/09/2024
Kareem Dadoul
43 questions

Question 118

Report
Export
Collapse

You have to initialize a Terraform backend before it can be configured.

True
True
False
False
Suggested answer: B

Explanation:

You can configure a backend in your Terraform code before initializing it. Initializing a backend will store the state file remotely and enable features like locking and workspaces.Reference= [Terraform Backends]

asked 18/09/2024
Muneer Deers
43 questions

Question 119

Report
Export
Collapse

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?

Use the terraform state rm command to remove the VM from state file
Use the terraform state rm command to remove the VM from state file
Use the terraform taint command targeting the VMs then run terraform plan and terraform apply
Use the terraform taint command targeting the VMs then run terraform plan and terraform apply
Use the terraform apply command targeting the VM resources only
Use the terraform apply command targeting the VM resources only
Delete the Terraform VM resources from your Terraform code then run terraform plan and terraform apply
Delete the Terraform VM resources from your Terraform code then run terraform plan and terraform apply
Suggested answer: B

Explanation:

The terraform taint command marks a resource as tainted, which means it will be destroyed and recreated on the next apply. This way, you can replace the VM instance without affecting the database or other resources.Reference= [Terraform Taint]

asked 18/09/2024
Neville Raposo
37 questions

Question 120

Report
Export
Collapse

How would you output returned values from a child module in the Terraform CLI output?

Declare the output in the root configuration
Declare the output in the root configuration
Declare the output in the child module
Declare the output in the child module
Declare the output in both the root and child module
Declare the output in both the root and child module
None of the above
None of the above
Suggested answer: C

Explanation:

To output returned values from a child module in the Terraform CLI output, you need to declare the output in both the child module and the root module. The child module output will return the value to the root module, and the root module output will display the value in the CLI.Reference= [Terraform Outputs]

asked 18/09/2024
Tuan Nguyen
41 questions
Total 195 questions
Go to page: of 20