ExamGecko
Home Home / HashiCorp / Terraform Associate 003

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

Question list
Search
Search

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

A.
Terraform plan --refresh-only
A.
Terraform plan --refresh-only
Answers
B.
Terraform show --json
B.
Terraform show --json
Answers
C.
Terraform apply --lock-false
C.
Terraform apply --lock-false
Answers
D.
Terraform plan target-state
D.
Terraform plan target-state
Answers
Suggested answer: A

Explanation:

This is the command that always causes a state file to be updated with changes that might have been made outside of Terraform, as it will only refresh the state file with the current status of the real resources, without making any changes to them or creating a plan.

You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (* files). You need to enable additional logging messages to find this out. Which of the following would achieve this?

A.
Set verbose for each provider in your Terraform configuration
A.
Set verbose for each provider in your Terraform configuration
Answers
B.
Set the environment variable TF_LOG_TRACE
B.
Set the environment variable TF_LOG_TRACE
Answers
C.
Set the environment variable TF_LOG_PATH
C.
Set the environment variable TF_LOG_PATH
Answers
D.
Set the environment variable TF_log_TRACE
D.
Set the environment variable TF_log_TRACE
Answers
Suggested answer: B

Explanation:

This will enable additional logging messages to find out from which paths Terraform is loading providers referenced in your Terraform configuration files, as it will set the log level toTRACE, which is the most verbose and detailed level.

Which of the following is not a valid Terraform collection type?

A.
Tree
A.
Tree
Answers
B.
Map
B.
Map
Answers
C.
List
C.
List
Answers
D.
set
D.
set
Answers
Suggested answer: A

Explanation:

This is not a valid Terraform collection type, as Terraform only supports three collection types: list, map, and set. A tree is a data structure that consists of nodes with parent-child relationships, which is not supported by Terraform.

What does state looking accomplish?

A.
Prevent accidental Prevent accident deletion of the state file
A.
Prevent accidental Prevent accident deletion of the state file
Answers
B.
Blocks Terraform commands from modifying, the state file
B.
Blocks Terraform commands from modifying, the state file
Answers
C.
Copies the state file from memory to disk
C.
Copies the state file from memory to disk
Answers
D.
Encrypts any credentials stored within the state file
D.
Encrypts any credentials stored within the state file
Answers
Suggested answer: B

Explanation:

This is what state locking accomplishes, by preventing other users from modifying the state file while a Terraform operation is in progress. This prevents conflicts and data loss.

What does this code do?

A.
Requires any version of the AWS provider > = 3.0 and <4.0
A.
Requires any version of the AWS provider > = 3.0 and <4.0
Answers
B.
Requires any version of the AWS provider >= 3.0
B.
Requires any version of the AWS provider >= 3.0
Answers
C.
Requires any version of the AWS provider > = 3.0 major release. like 4.1
C.
Requires any version of the AWS provider > = 3.0 major release. like 4.1
Answers
D.
Requires any version of the AWS provider > 3.0
D.
Requires any version of the AWS provider > 3.0
Answers
Suggested answer: A

Explanation:

This is what this code does, by using the pessimistic constraint operator (~>), which specifies an acceptable range of versions for a provider or module.

Only the user that generated a plan may apply it.

A.
True
A.
True
Answers
B.
False
B.
False
Answers
Suggested answer: B

Explanation:

Any user with permission to apply a plan can apply it, not only the user that generated it. This allows for collaboration and delegation of tasks among team members.

You cannot install third party plugins using terraform init.

A.
True
A.
True
Answers
B.
False
B.
False
Answers
Suggested answer: B

Explanation:

You can install third party plugins usingterraform init, as long as you specify the plugin directory in your configuration or as a command-line argument. You can also use theterraform providers mirrorcommand to create a local mirror of providers from any source.

Which of these ate features of Terraform Cloud? Choose two correct answers.

A.
Automated infrastructure deployment visualization
A.
Automated infrastructure deployment visualization
Answers
B.
Automatic backups
B.
Automatic backups
Answers
C.
A web-based user interface (Ul)
C.
A web-based user interface (Ul)
Answers
D.
Remote state storage
D.
Remote state storage
Answers
Suggested answer: C, D

Explanation:

These are features of Terraform Cloud, which is a hosted service that provides a web-based UI, remote state storage, remote operations, collaboration features, and more for managing your Terraform infrastructure.

Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into stdout.

A.
True
A.
True
Answers
B.
False
B.
False
Answers
Suggested answer: A

Explanation:

Setting theTF_LOGenvironment variable toDEBUGcauses debug messages to be logged into stdout, along with other log levels such asTRACE,INFO,WARN, andERROR. This can be useful for troubleshooting or debugging purposes.

How does the Terraform cloud integration differ from other state backends such as S3, Consul,etc?

A.
It can execute Terraform runs on dedicated infrastructure in Terraform Cloud
A.
It can execute Terraform runs on dedicated infrastructure in Terraform Cloud
Answers
B.
It doesn't show the output of a terraform apply locally
B.
It doesn't show the output of a terraform apply locally
Answers
C.
It is only arable lo paying customers
C.
It is only arable lo paying customers
Answers
D.
All of the above
D.
All of the above
Answers
Suggested answer: A

Explanation:

This is how the Terraform Cloud integration differs from other state backends such as S3, Consul, etc., as it allows you to perform remote operations on Terraform Cloud's servers instead of your local machine. The other options are either incorrect or irrelevant.

Total 195 questions
Go to page: of 20