Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
 

HashiCorp Terraform Associate Exam Actual Questions

The questions for Terraform Associate were last updated on June 26, 2024.
  • Viewing page 1 out of 33 pages.
  • Viewing questions 1-10 out of 329 questions

Topic 1 - Single Topic

Question #1 Topic 1

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

  • A. True
  • B. False
Reveal Solution Hide Solution   Discussion   36

Correct Answer: B 🗳️
Reference:
https://www.terraform.io/docs/language/state/index.html

Question #2 Topic 1

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

  • A. True
  • B. False
Reveal Solution Hide Solution   Discussion   42

Correct Answer: A 🗳️
Reference:
https://www.terraform.io/docs/language/settings/backends/remote.html

Question #3 Topic 1

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
Reveal Solution Hide Solution   Discussion   19

Correct Answer: A 🗳️
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

Question #4 Topic 1

What is the workflow for deploying new infrastructure with Terraform?

  • A. terraform plan to import the current infrastructure to the state file, make code changes, and terraform apply to update the infrastructure.
  • B. Write a Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure.
  • C. terraform import 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.
Reveal Solution Hide Solution   Discussion   21

Correct Answer: D 🗳️

Question #5 Topic 1

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

  • A. True
  • B. False
Reveal Solution Hide Solution   Discussion   124

Correct Answer: A 🗳️
Reference:
https://github.com/hashicorp/terraform/issues/17928

Question #6 Topic 1

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
Reveal Solution Hide Solution   Discussion   43

Correct Answer: A 🗳️

Question #7 Topic 1

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

  • A. remote-exec
  • B. null-exec
  • C. local-exec
  • D. file
Reveal Solution Hide Solution   Discussion   17

Correct Answer: A 🗳️
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

Question #8 Topic 1

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
Reveal Solution Hide Solution   Discussion   36

Correct Answer: D 🗳️
Reference:
https://jayendrapatil.com/terraform-cheat-sheet/#Terraform_Read_and_write_configuration

Question #9 Topic 1

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
Reveal Solution Hide Solution   Discussion   9

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

Question #10 Topic 1

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?

  • 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
Reveal Solution Hide Solution   Discussion   40

Correct Answer: A 🗳️
Reference:
https://www.terraform.io/docs/cli/commands/output.html

Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
ex Want to SAVE BIG on Certification Exam Prep?
close
ex Unlock All Exams with ExamTopics Pro 75% Off
  • arrow Choose From 1000+ Exams
  • arrow Access to 10 Exams per Month
  • arrow PDF Format Available
  • arrow Inline Discussions
  • arrow No Captcha/Robot Checks
Limited Time Offer
Ends in