HashiCorp VA-002-P HashiCorp Certified: Vault Associate Exam Practice Test

Page: 1 / 14
Total 200 questions
Question 1

A user creates three workspaces from the command line - prod, dev, and test. Which of the following commands will the user run to switch to the dev workspace?



Question 2

In terraform, most resource dependencies are handled automatically. Which of the following statements describes best how terraform resource dependencies are handled?



Answer : B

Terraform analyses any expressions within a resource block to find references to other objects and treats those references as implicit ordering requirements when creating, updating, or destroying resources.

https://www.terraform.io/docs/configuration/resources.html


Question 3

A user has created a module called "my_test_module" and committed it to GitHub. Over time, several commits have been made with updates to the module, each tagged in GitHub with an incremental version number. Which of the following lines would be required in a module configuration block in terraform to select tagged version v1.0.4?



Answer : C

By default, Terraform will clone and use the default branch (referenced by HEAD) in the selected repository. You can override this using the ref argument:

module 'vpc' {source = 'git::https://wpexpertsupport.com/vpc.git?ref=v1.2.0'}

The value of the ref argument can be any reference that would be accepted by the git checkout command, including branch and tag names.

https://www.terraform.io/docs/modules/sources.html#selecting-a-revision


Question 4

The following is a snippet from a Terraform configuration file:

1. provider "aws" {

2. region = "us-east-1"

3. }

4. provider "aws" {

5. region = "us-west-1"

6. }

which, when validated, results in the following error:-

1. Error: Duplicate provider configuration

2.

3. on main.tf line 5:

4. 5: provider "aws" {

5.

6. A default provider configuration for "aws" was already given at

7. main.tf:1,1-15. If multiple configurations are required, set the "______"

8. argument for alternative configurations.

Fill in the blank in the error message with the correct string from the list below.



Answer : C

An alias meta-argument is used when using the same provider with different configurations for different resources.

https://www.terraform.io/docs/configuration/providers.html#alias-multiple-provider-instances


Question 5

What is the result of the following terraform function call?

index(["a", "b", "c"], "c")



Answer : C

index finds the element index for a given value in a list starting with index 0.

https://www.terraform.io/docs/configuration/functions/index.html


Question 6

Terraform Cloud is more powerful when you integrate it with your version control system (VCS) provider. Select all the supported VCS providers from the answers below. (select four)



Answer : B, C, D, E

Terraform Cloud supports the following VCS providers:

- GitHub

- GitHub.com (OAuth)

- GitHub Enterprise

- GitLab.com

- GitLab EE and CE

- Bitbucket Cloud

- Bitbucket Server

- Azure DevOps Server

- Azure DevOps Services

https://www.terraform.io/docs/cloud/vcs/index.html#supported-vcs-providers


Question 7

When writing the Terraform code, HashiCorp recommends that you use how many spaces between each nesting level?



Answer : A

HashiCorp style conventions state that you should use 2 spaces between each nesting level to improve the readability of Terraform configurations.


Page:    1 / 14   
Total 200 questions