Sign In
Home/HashiCorp/Terraform Associate/Free questions

Terraform Associate — Free Practice Questions

10 free sample questions from a bank of 323, with the correct answers and explanations. No signup required — start practising right now.

1The terraform.tfstate file always matches your currently built infrastructure.
  • True
  • False
Answer: B
2You 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?
  • Run terraform output ip_address to view the result
  • 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 destroy then terraform apply and look for the IP address in stdout
Answer: C
3You have declared an input variable called environment in your parent module. What must you do to pass the value to a child module in the configuration?
  • Add node_count = var.node_count
  • Declare the variable in a terraform.tfvars file
  • Declare a node_count input variable for child module
  • Nothing, child modules inherit variables of parent module
Answer: C
4If a module declares a variable with a default, that variable must also be defined within the module.
  • True
  • False
Answer: B
5Which option cannot be used to keep secrets out of Terraform configuration files?
  • Environment Variables
  • Mark the variable as sensitive
  • A Terraform provider
  • A -var flag
Answer: B
6Which of the following arguments are required when declaring a Terraform output?
  • sensitive
  • description
  • default
  • value
Answer: D
7Your risk management organization requires that new AWS S3 buckets must be private and encrypted at rest. How can Terraform Enterprise automatically and proactively enforce this security control?
  • With a Sentinel policy, which runs before every apply
  • By adding variables to each TFE workspace to ensure these settings are always enabled
  • With an S3 module with proper settings for buckets
  • Auditing cloud storage buckets with a vulnerability scanning tool
Answer: A
8Most Terraform providers interact with ____________.
  • API
  • VCS Systems
  • Shell scripts
  • None of the above
Answer: A
9terraform validate validates that your infrastructure matches the Terraform state file.
  • True
  • False
Answer: B
10What does terraform import allow you to do?
  • Import a new Terraform module
  • Use a state file to import infrastructure to the cloud
  • Import provisioned infrastructure to your state file
  • Import an existing state file to a new Terraform workspace
Answer: C

Want the full bank of 323 questions for Terraform Associate? See all practice exams.