ExamGecko
Home / HashiCorp / Terraform Associate 003
Ask Question

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

Question list
Search

Question 31

Report
Export
Collapse

If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform Init.

True
True
False
False
Suggested answer: A

Explanation:

If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you runterraform init3. This will ensure that you use the same provider versions across different machines and runs.

asked 18/09/2024
Genivaldo Costa
42 questions

Question 32

Report
Export
Collapse

Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?

terraform destroy, then terraform apply
terraform destroy, then terraform apply
terraform init
terraform init
terraform push
terraform push
terraform apply
terraform apply
Suggested answer: A

Explanation:

This command will initialize the new backend and prompt you to migrate the existing state file to the new location4. The other commands are not relevant for this task.

asked 18/09/2024
Kristi Riddick
29 questions

Question 33

Report
Export
Collapse

What does Terraform use the .terraform.lock.hc1 file for?

There is no such file
There is no such file
Tracking specific provider dependencies
Tracking specific provider dependencies
Preventing Terraform runs from occurring
Preventing Terraform runs from occurring
Storing references to workspaces which are locked
Storing references to workspaces which are locked
Suggested answer: B

Explanation:

The.terraform.lock.hclfile is a new feature in Terraform 0.14 that records the exact versions of each provider used in your configuration. This helps ensure consistent and reproducible behavior across different machines and runs.

asked 18/09/2024
Vishal Gandhi
33 questions

Question 34

Report
Export
Collapse

Why does this backend configuration not follow best practices?

HashiCorp Terraform Associate 003 image Question 34 30472 09182024192049000000

An alias meta-argument should be included in backend blocks whenever possible
An alias meta-argument should be included in backend blocks whenever possible
You should use the local enhanced storage backend whenever possible
You should use the local enhanced storage backend whenever possible
You should not store credentials in Terraform configuration
You should not store credentials in Terraform configuration
The backend configuration should contain multiple credentials so that more than one user can execute terraform plan and terraform apply
The backend configuration should contain multiple credentials so that more than one user can execute terraform plan and terraform apply
Suggested answer: C

Explanation:

This is a bad practice, as it exposes your credentials to anyone who can access your configuration files or state files. You should use environment variables, credential files, or other mechanisms to provide credentials to Terraform.

asked 18/09/2024
Zarate, Wilfredo
41 questions

Question 35

Report
Export
Collapse

It is best practice to store secret data in the same version control repository as your Terraform configuration.

True
True
False
False
Suggested answer: B

Explanation:

It is not a best practice to store secret data in the same version control repository as your Terraform configuration, as it could expose your sensitive information to unauthorized parties or compromise your security. You should use environment variables, vaults, or other mechanisms to store and provide secret data to Terraform.

asked 18/09/2024
Rafal Piasecki
40 questions

Question 36

Report
Export
Collapse

_______backends support state locking.

All
All
No
No
Some
Some
Only local
Only local
Suggested answer: C

Explanation:

Some backends support state locking, which prevents other users from modifying the state file while a Terraform operation is in progress. This prevents conflicts and data loss. Not all backends support this feature, and you can check the documentation for each backend type to see if it does.

asked 18/09/2024
harinder giri
33 questions

Question 37

Report
Export
Collapse

You want to define a single input variable to capture configuration values for a server. The values must represent memory as a number, and the server name as a string.

Which variable type could you use for this input?

List
List
Object
Object
Map
Map
Terraform does not support complex input variables of different types
Terraform does not support complex input variables of different types
Suggested answer: B

Explanation:

This is the variable type that you could use for this input, as it can store multiple attributes of different types within a single value. The other options are either invalid or incorrect for this use case.

asked 18/09/2024
Christina Chelioti
36 questions

Question 38

Report
Export
Collapse

Which of the following statements about Terraform modules is not true?

Modules can call other modules
Modules can call other modules
A module is a container for one or more resources
A module is a container for one or more resources
Modules must be publicly accessible
Modules must be publicly accessible
You can call the same module multiple times
You can call the same module multiple times
Suggested answer: C

Explanation:

This is not true, as modules can be either public or private, depending on your needs and preferences. You can use the Terraform Registry to publish and consume public modules, or use Terraform Cloud or Terraform Enterprise to host and manage private modules.

asked 18/09/2024
Arun kumar
37 questions

Question 39

Report
Export
Collapse

When you use a remote backend that needs authentication, HashiCorp recommends that you:

Write the authentication credentials in the Terraform configuration files
Write the authentication credentials in the Terraform configuration files
Keep the Terraform configuration files in a secret store
Keep the Terraform configuration files in a secret store
Push your Terraform configuration to an encrypted git repository
Push your Terraform configuration to an encrypted git repository
Use partial configuration to load the authentication credentials outside of the Terraform code
Use partial configuration to load the authentication credentials outside of the Terraform code
Suggested answer: D

Explanation:

This is the recommended way to use a remote backend that needs authentication, as it allows you to provide the credentials via environment variables, command-line arguments, or interactive prompts, without storing them in the Terraform configuration files.

asked 18/09/2024
Sterling White
47 questions

Question 40

Report
Export
Collapse

You can reference a resource created with for_each using a Splat ( *) expression.

True
True
False
False
Suggested answer: B

Explanation:

You cannot reference a resource created withfor_eachusing a splat (*) expression, as it will not work with resources that have non-numeric keys. You need to use aforexpression instead to iterate over the resource instances.

asked 18/09/2024
Pooja Pendyala
39 questions
Total 195 questions
Go to page: of 20