HashiCorp TERRAFORM ASSOCIATE Exam Questions

Questions for the TERRAFORM ASSOCIATE were updated on : Nov 16 ,2024

Page 1 out of 26. Viewing questions 1-15 out of 382

Question 1

The terraform.tfstate file always matches your currently built infrastructure.

  • A. True
  • B. False
Answer:

B

User Votes:
A
50%
B 1 votes
50%

Explanation:
Reference:
https://www.terraform.io/docs/language/state/index.html

Discussions
vote your answer:
A
B
0 / 1000

Question 2

One remote backend configuration always maps to a single remote workspace.

  • A. True
  • B. False
Answer:

A

User Votes:
A
50%
B 1 votes
50%

Explanation:
Reference:
https://www.terraform.io/docs/language/settings/backends/remote.html

Discussions
vote your answer:
A
B
0 / 1000

Question 3

How is the Terraform remote backend different than other state backends such as S3, Consul, etc.?

  • A. It can execute Terraform runs on dedicated infrastructure on premises or in Terraform Cloud
  • B. It doesn't show the output of a terraform apply locally
  • C. It is only available to paying customers
  • D. All of the above
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%

Explanation:
If you and your team are using Terraform to manage meaningful infrastructure, we recommend using
the remote backend with Terraform Cloud or Terraform Enterprise.
Reference:
https://www.terraform.io/docs/language/settings/backends/index.html

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 4

What is the workflow for deploying new infrastructure with Terraform?

  • B. Write a Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure.
  • C. terraform plan to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure
  • D. Write a Terraform configuration, run terraform init, run terraform plan to view planned infrastructure changes, and terraform apply to create new infrastructure.
Answer:

C

User Votes:
B
50%
C
50%
D 1 votes
50%

Explanation:
Reference:
https://www.google.com/search?q=Write+a+Terraform+configuration%2C+run+terraform+init%2C
+run+terraform+plan+to+view+planned+infrastructure+changes%2C+and+terraform+apply+to+creat
e+new
+infrastructure.&oq=Write+a+Terraform+configuration%2C+run+terraform+init%2C+run+terraform+
plan+to
+view+planned+infrastructure+changes%2C+and+terraform+apply+to+create+new
+infrastructure.&aqs=chrome..69i57.556j0j7&sourceid=chrome&ie=UTF-8

Discussions
vote your answer:
B
C
D
0 / 1000

Question 5

A provider configuration block is required in every Terraform configuration.
Example:

  • A. True
  • B. False
Answer:

A

User Votes:
A
50%
B 1 votes
50%

Explanation:
Reference:
https://github.com/hashicorp/terraform/issues/17928

Discussions
vote your answer:
A
B
0 / 1000

Question 6

You run a local-exec provisioner in a null resource called null_resource.run_script and realize that you
need to rerun the script.
Which of the following commands would you use first?

  • A. terraform taint null_resource.run_script
  • B. terraform apply -target=null_resource.run_script
  • C. terraform validate null_resource.run_script
  • D. terraform plan -target=null_resource.run_script
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 7

Which provisioner invokes a process on the resource created by Terraform?

  • A. remote-exec
  • B. null-exec
  • C. local-exec
  • D. file
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%

Explanation:
The remote-exec provisioner invokes a script on a remote resource after it is created. Reference:
https://www.terraform.io/docs/language/resources/provisioners/remote-exec.html

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 8

Which of the following is not true of Terraform providers?

  • A. Providers can be written by individuals
  • B. Providers can be maintained by a community of users
  • C. Some providers are maintained by HashiCorp
  • D. Major cloud vendors and non-cloud vendors can write, maintain, or collaborate on Terraform providers
  • E. None of the above
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%
E 1 votes
50%

Explanation:
Reference:
https://jayendrapatil.com/terraform-cheat-
sheet/#Terraform_Read_and_write_configuration

Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 9

What command does Terraform require the first time you run it within a configuration directory?

  • A. terraform import
  • B. terraform init
  • C. terraform plan
  • D. terraform workspace
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%

Explanation:
terraform init command is used to initialize a working directory containing Terraform configuration
files. Reference:
https://www.terraform.io/docs/cli/commands/init.html

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 10

You have deployed a new webapp with a public IP address on a clod 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?

  • A. Run terraform output ip_address to view the result
  • B. 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
  • C. Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address
  • D. Run terraform destroy then terraform apply and look for the IP address in stdout
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%

Explanation:
Reference:
https://www.terraform.io/docs/cli/commands/output.html

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 11

Which of the following is not a key principle of infrastructure as code?

  • A. Versioned infrastructure
  • B. Golden images
  • C. Idempotence
  • D. Self-describing infrastructure
Answer:

ABD

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%

Explanation:
Reference:
https://docs.microsoft.com/en-us/azure/devops/learn/what-is-infrastructure-as
-
code#:~:text=Idempotence%20is%20a%20principle%20of,of%20the%20environment's%20starting%
20state.

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 12

Terraform variables and outputs that set the "description" argument will store that description in the
state file.

  • A. True
  • B. False
Answer:

B

User Votes:
A
50%
B 1 votes
50%

Explanation:
Reference:
https://www.terraform.io/docs/language/values/outputs.html

Discussions
vote your answer:
A
B
0 / 1000

Question 13

What is the provider for this fictitious resource?

  • A. vpc
  • B. main
  • C. aws
  • D. test
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%

Explanation:
Reference:
https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-types.html

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14

If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?

  • A. Run terraform refresh
  • B. It will happen automatically
  • C. Manually update the state fire
  • D. Run terraform import
Answer:

A

User Votes:
A
50%
B
50%
C
50%
D 1 votes
50%

Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 15

What is not processed when running a terraform refresh?

  • A. State file
  • B. Configuration file
  • C. Credentials
  • D. Cloud provider
Answer:

CD

User Votes:
A 1 votes
50%
B
50%
C
50%
D
50%

Explanation:
Reference:
https://www.terraform.io/docs/cli/commands/refresh.html

Discussions
vote your answer:
A
B
C
D
0 / 1000
To page 2