HashiCorp terraform associate practice test

HashiCorp Certified: Terraform Associate Exam

Last exam update: Sep 12 ,2024
Page 1 out of 25. Viewing questions 1-15 out of 382

Question 1

Using the terraform state rm command against a resource will destroy it.

  • A. True
  • B. False
Answer:

B


User Votes:
A
50%
B 1 votes
50%
Discussions
vote your answer:
A
B
0 / 1000

Question 2

terraform destroy is the only way to remove infrastructure.
A. True
B. False

Answer:

B


Discussions
0 / 1000

Question 3

A Terraform output that sets the ''sensitive'' argument to true will not store that value in the state
file.

  • A. True
  • B. False
Answer:

B


User Votes:
A
50%
B
50%
Discussions
vote your answer:
A
B
0 / 1000

Question 4

Why should secrets not be hard coded into Terraform code? Choose two correct answers

  • A. All passwords should be rotated on a quarterly basis.
  • B. The Terraform code is copied to the target resources to be applied locally and could expose secrets if a target resource is compromised.
  • C. Terraform code is typically stored in version control, as well as copied to the systems from h it's run. Any of those may not have robust security mechanisms.
  • D. It makes the code less reusable.
Answer:

C, D


User Votes:
A
50%
B
50%
C 1 votes
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 5

Terraform configuration (including any module references) can contain only one Terraform provider
type.

  • A. True
  • B. False
Answer:

B


User Votes:
A
50%
B
50%
Discussions
vote your answer:
A
B
0 / 1000

Question 6

terraform init retrieves the source code tot all referenced modules
A. True
B. False

Answer:

A


Discussions
0 / 1000

Question 7

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

You immediately run terraform apply but don't see any changes. Your state file didn't move. Which
command will migrate your current state file to the new S3 remote backend?

  • A. terraform push
  • B. terraform init
  • C. terraform refresh
  • D. terraform state
Answer:

B


User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 8

How would you be able to reference an attribute from the vsphere_datacenter data source for use
with the argument within the vsprere_folder resource in the following configuration?

  • A. vsphere_datacenter.dc.id
  • B. data.vsphere_datacenter.dc
  • C. data.dc,id
  • D. data.vsphere_datacenter.dc.id
Answer:

D


User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 9

What is the purpose of a Terraform workspace in either open source of enterprise?

  • A. Workspaces allow you to manage collections of infrastructure in state files.
  • B. A logical separation of business units
  • C. A method of grouping multiple infrastructure security policies
  • D. Provides limited access to a cloud environment
Answer:

B


User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 10

In the below configuration, how would you reference the module output vpc_id ?

Type your answer in the field provided. The text field is not case-sensitive and all variations of the
correct answer are accepted.

Answer:

module.vpc.id


Discussions
0 / 1000

Question 11

Which Terraform collection type should you use to store key/value pairs?

  • A. set
  • B. tuple
  • C. list
  • D. map
Answer:

D


User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 12

If a Terraform creation-time provisioner fails, what will occur by default?

  • A. The resource will not be affected, but the provisioner will need to be applied again
  • B. The resource will be destroyed
  • C. The resource will be marked as "tainted"
  • D. Nothing, provisioners will not show errors in the command line
Answer:

C


User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 13

What does this code do?

  • A. Requires any version of the AWS provider > = 3.0 and < 4.0
  • B. Requires any version of the AWS provider > = 3.0
  • C. Requires any version of the AWS provider after the 3.0 major release like 4.1
  • D. Requires any version of the AWS provider > 3.0
Answer:

A


User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14

Which of the following can you do with terraform plan? Choose two correct answers.

  • A. View the execution plan and check if the changes match your expectations
  • B. Schedule Terraform to run at a planned time in the future
  • C. Execute a plan in a different workspace
  • D. Save a generated execution plan to apply later
Answer:

A, D


User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 15

How would you reference the attribute "name* of this fictitious resource in HCL?

A. resource.kubrnetes_namespace>example.name
B. kubernetes_namespace.test.name
C. kubernetes_namespace.example,name
D. data kubernetes_namespace.name
E. None of the above

Answer:

C


Discussions
0 / 1000
To page 2