ExamGecko
Home / HashiCorp / Terraform Associate 003
Ask Question

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

Question list
Search

Question 91

Report
Export
Collapse

What feature stops multiple users from operating on the Terraform state at the same time?

State locking
State locking
Version control
Version control
Provider constraints
Provider constraints
Remote backends
Remote backends
Suggested answer: A

Explanation:

State locking prevents other users from modifying the state file while a Terraform operation is in progress.This prevents conflicts and data loss1.

asked 18/09/2024
Valerio Pietrantoni
44 questions

Question 92

Report
Export
Collapse

Which of the following is not a valid siring function in Terraform?

choaf
choaf
join
join
Split
Split
slice
slice
Suggested answer: A

Explanation:

This is not a valid string function in Terraform.The other options are valid string functions that can manipulate strings in various ways2.

asked 18/09/2024
mostafa khalaf
53 questions

Question 93

Report
Export
Collapse

Module variable assignments are inherited from the parent module and you do not need to explicitly set them.

True
True
False
False
Suggested answer: B

Explanation:

Module variable assignments are not inherited from the parent module and you need to explicitly set them using thesourceargument. This allows you to customize the behavior of each module instance.

asked 18/09/2024
Donna Brown
38 questions

Question 94

Report
Export
Collapse

What are some benefits of using Sentinel with Terraform Cloud/Terra form Cloud? Choose three correct answers.

You can enforce a list of approved AWS AMIs
You can enforce a list of approved AWS AMIs
Policy-as-code can enforce security best practices
Policy-as-code can enforce security best practices
You can check out and check in cloud access keys
You can check out and check in cloud access keys
You can restrict specific resource configurations, such as disallowing the use of CIDR=0.0.0.0/0.
You can restrict specific resource configurations, such as disallowing the use of CIDR=0.0.0.0/0.
Sentinel Policies can be written in HashiCorp Configuration Language (HCL)
Sentinel Policies can be written in HashiCorp Configuration Language (HCL)
Suggested answer: A, B, D

Explanation:

These are some of the benefits of using Sentinel with Terraform Cloud/Terraform Enterprise, as they allow you to implement logic-based policies that can access and evaluate the Terraform plan, state, and configuration. The other options are not true, as Sentinel does not manage cloud access keys, and Sentinel policies are written in Sentinel language, not HCL.

asked 18/09/2024
Marcin Piotrowski
40 questions

Question 95

Report
Export
Collapse

What does Terraform not reference when running a terraform apply -refresh-only ?

State file
State file
Credentials
Credentials
Cloud provider
Cloud provider
Terraform resource definitions in configuration files
Terraform resource definitions in configuration files
Suggested answer: D

Explanation:

When running aterraform apply -refresh-only, Terraform does not reference the configuration files, but only the state file, credentials, and cloud provider.The purpose of this command is to update the state file with the current status of the real resources, without making any changes to them1.

asked 18/09/2024
Tillmon, Quinton
37 questions

Question 96

Report
Export
Collapse

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

list
list
array
array
nap
nap
string
string
Suggested answer: B

Explanation:

This is not a valid Terraform variable type.The other options are valid variable types that can store different kinds of values2.

asked 18/09/2024
Herbert Hartwell
38 questions

Question 97

Report
Export
Collapse

You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into a file called backend.tf.

HashiCorp Terraform Associate 003 image Question 97 30535 09182024192049000000

Which command will migrate your current state file to the new S3 remote backend?

terraform state
terraform state
terraform init
terraform init
terraform push
terraform push
terraform refresh
terraform refresh
Suggested answer: B

Explanation:

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

asked 18/09/2024
TRAORE Issa
33 questions

Question 98

Report
Export
Collapse

Your DevOps team is currently using the local backend for your Terraform configuration. You would like to move to a remote backend to store the state file in a central location. Which of the following backends would not work?

Artifactory
Artifactory
Amazon S3
Amazon S3
Terraform Cloud
Terraform Cloud
Git
Git
Suggested answer: D

Explanation:

This is not a valid backend for Terraform, as it does not support locking or versioning of state files4. The other options are valid backends that can store state files in a central location.

asked 18/09/2024
Baljit Bhadare
39 questions

Question 99

Report
Export
Collapse

You have deployed a new webapp with a public IP address on a cloud provider. However, you did not create any outputs for your code. What is the best method to quickly find the IP address of the resource you deployed?

In a new folder, use the terraform_remote_state data source to load in the state file, then write an output for each resource that you find the state file
In a new folder, use the terraform_remote_state data source to load in the state file, then write an output for each resource that you find the state file
Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address
Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address
Run terraform output ip_address to view the result
Run terraform output ip_address to view the result
Run terraform destroy then terraform apply and look for the IP address in stdout
Run terraform destroy then terraform apply and look for the IP address in stdout
Suggested answer: B

Explanation:

This is a quick way to inspect the state file and find the information you need without modifying anything5. The other options are either incorrect or inefficient.

asked 18/09/2024
FL Ferdous Attaie
36 questions

Question 100

Report
Export
Collapse

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

terraform refresh -upgrade
terraform refresh -upgrade
terraform apply -upgrade
terraform apply -upgrade
terraform init -upgrade
terraform init -upgrade
terraform providers -upgrade
terraform providers -upgrade
Suggested answer: C

Explanation:

This command will upgrade the plugins to the latest acceptable version within the version constraints specified in the configuration. The other commands do not have an-upgradeoption.

asked 18/09/2024
Norman Camacho
47 questions
Total 195 questions
Go to page: of 20