Terraform AssociateFree trialFree trial

By hashicorp
Aug, 2025

Verified

25Q per page

Question 1

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

  • A: True
  • B: False

Question 2

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

Question 3

You 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?

  • A: Add node_count = var.node_count
  • B: Declare the variable in a terraform.tfvars file
  • C: Declare a node_count input variable for child module
  • D: Nothing, child modules inherit variables of parent module

Question 4

If a module declares a variable with a default, that variable must also be defined within the module.

  • A: True
  • B: False

Question 5

Which option cannot be used to keep secrets out of Terraform configuration files?

  • A: Environment Variables
  • B: Mark the variable as sensitive
  • C: A Terraform provider
  • D: A -var flag

Question 6

Which of the following arguments are required when declaring a Terraform output?

  • A: sensitive
  • B: description
  • C: default
  • D: value

Question 7

Your 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?

  • A: With a Sentinel policy, which runs before every apply
  • B: By adding variables to each TFE workspace to ensure these settings are always enabled
  • C: With an S3 module with proper settings for buckets
  • D: Auditing cloud storage buckets with a vulnerability scanning tool

Question 8

Most Terraform providers interact with ____________.

  • A: API
  • B: VCS Systems
  • C: Shell scripts
  • D: None of the above

Question 9

terraform validate validates that your infrastructure matches the Terraform state file.

  • A: True
  • B: False

Question 10

What does terraform import allow you to do?

  • A: Import a new Terraform module
  • B: Use a state file to import infrastructure to the cloud
  • C: Import provisioned infrastructure to your state file
  • D: Import an existing state file to a new Terraform workspace

Question 11

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

Image 1

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

Question 12

How would you reference the Volume IDs associated with the ebs_block_device blocks in this configuration?

Image 1
  • A: aws_instance.example.ebs_block_device.[*].volume_id
  • B: aws_instance.example.ebs_block_device.volume_id
  • C: aws_instance.example.ebs_block_device[sda2,sda3].volume_id
  • D: aws_instance.example.ebs_block_device.*.volume_id

Question 13

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

Question 14

What does state locking accomplish?

  • A: Copies the state file from memory to disk
  • B: Encrypts any credentials stored within the state file
  • C: Blocks Terraform commands from modifying the state file
  • D: Prevents accidental deletion of the state file

Question 15

You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?

  • A: Run terraform apply -upgrade
  • B: Run terraform init -upgrade
  • C: Run terraform refresh
  • D: Upgrade your version of Terraform

Question 16

A module can always refer to all variables declared in its parent module.

  • A: True
  • B: False

Question 17

When you use a remote backend that needs authentication, HashiCorp recommends that you:

  • A: Use partial configuration to load the authentication credentials outside of the Terraform code
  • B: Push your Terraform configuration to an encrypted git repository
  • C: Write the authentication credentials in the Terraform configuration files
  • D: Keep the Terraform configuration files in a secret store

Question 18

You have a simple Terraform configuration containing one virtual machine (VM) in a cloud provider. You run terraform apply and the VM is created successfully.
What will happen if you terraform apply again immediately afterwards without changing any Terraform code?

  • A: Terraform will terminate and recreate the VM
  • B: Terraform will create another duplicate VM
  • C: Terraform will apply the VM to the state file
  • D: Nothing

Question 19

A junior admin accidentally deleted some of your cloud instances. What does Terraform do when you run terraform apply?

  • A: Build a completely brand new set of infrastructure
  • B: Tear down the entire workspace infrastructure and rebuild it
  • C: Rebuild only the instances that were deleted
  • D: Stop and generate an error message about the missing instances

Question 20

You have created a main.tr Terraform configuration consisting of an application server, a database, and a load balancer. You ran terraform apply and all resources were created successfully. Now you realize that you do not actually need the load balancer so you run terraform destroy without any flags What will happen?

  • A: Terraform will destroy the application server because it is listed first in the code
  • B: Terraform will prompt you to confirm that you want to destroy all the infrastructure
  • C: Terraform will destroy the main.tf file
  • D: Terraform will prompt you to pick which resource you want to destroy
  • E: Terraform will immediately destroy all the infrastructure

Question 21

Which type of block fetches or computes information for use elsewhere in a Terraform configuration?

  • A: provider
  • B: resource
  • C: local
  • D: data

Question 22

You have just developed a new Terraform configuration for two virtual machines with a cloud provider. You would like to create the infrastructure for the first time.
Which Terraform command should you run first?

  • A: terraform apply
  • B: terraform plan
  • C: terraform show
  • D: terraform init

Question 23

All modules published on the official Terraform Module Registry have been verified by HashiCorp.

  • A: True
  • B: False

Question 24

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

  • A: True
  • B: False

Question 25

You have to initialize a Terraform backend before it can be configured.

  • A: True
  • B: False
Page 1 of 15 • Questions 1-25 of 358

Free preview mode

Enjoy the free questions and consider upgrading to gain full access!