Browse all practice questions for the HashiCorp Terraform Infrastructure as Code (IaC) Practice Test. Search by topic, open any question and review its full explanation, then test yourself in the practice quiz.

HashiCorp Terraform Infrastructure as Code (IaC) Practice Test course image
More practice questions

These questions are part of the practice quiz. Start practicing

  • Which provider would you configure to manage AWS resources in Terraform?
  • What type of configuration does Terraform primarily manage?
  • How does Terraform handle sensitive variables?
  • Where can an API Token for Terraform Cloud or Terraform Enterprise be stored?
  • Which command initializes a Terraform configuration?
  • What type of resources can Terraform manage?
  • Which file extensions are associated with Terraform configuration files?
  • What is the primary language used to write Terraform configurations?
  • What does the 'terraform refresh' command do?
  • What is the primary function of the 'terraform login' command?
  • What does the `terraform plan` command do?
  • How can outputs be exported in Terraform?
  • Which command is used to show a resource in the Terraform state?
  • What is the recommended approach to protect sensitive data identified by the security team in Terraform state files?
  • What is the best practice to protect sensitive values in Terraform state files?
  • Which of the following resources can be created using Terraform?
  • In Terraform, what does the 'terraform init' command do?
  • What is the primary purpose of Terraform?
  • What is the default state file for Terraform?
  • Which of the following types in Terraform is considered a complex type?
  • Which command would you use to test your Terraform configuration without applying it?
  • What is the name of the dependency lock file created by Terraform when it locks its state?
  • How is versioning handled in Terraform?
  • Which of the following is a valid terraform import command?
  • What is the function of the 'terraform import' command?
  • In regards to backend configuration, what is the default behavior of specifying a remote backend?
  • What is Terraform primarily used for?
  • What does the Terraform command 'terraform apply -refresh-only' do?
  • Why is it important to use remote state storage?
  • Which Terraform Workflow involves a backend configured to use Terraform Cloud and pull requests for changes?
  • Which file extension is commonly used for Terraform configuration files?
  • How can you prevent certain resources from being destroyed in Terraform?
  • What does the 'terraform state' command do?
  • Which command initializes a directory containing Terraform configuration files?
  • What command initializes a Terraform configuration?
  • How do you set a custom path for Terraform Logging via environment variable?
  • Which of the following is NOT a valid string function in Terraform?
  • Which file type is used to define the resources and configurations for Terraform?
  • How does Terraform manage state?
  • When running a terraform refresh command, which of the following is NOT processed?
  • What does the command 'terraform state show' do?
  • What file extension is typically used for Terraform configuration files?
  • Can a Terraform local value reference other local values?
  • Is it mandatory to include a provider configuration block in every Terraform configuration?
  • What subcommand would you use to list all resources in the Terraform state?
  • How can outputs be utilized in Terraform?
  • What does the 'terraform output' command provide?
  • What does the coalesce built-in function in Terraform return?
  • What is the purpose of the triggers block in a null_resource?
  • Which Terraform command is used to validate configurations?
  • What is a data source in Terraform?
  • What command will get the latest version of plugins in Terraform that complies with the configuration's version constraints?
  • In Terraform, what is a workspace?
  • What block structure correctly defines a remote backend to Amazon S3?
  • In Terraform, what does the term 'state' refer to?
  • How can you protect sensitive information in Terraform variables?
  • How can you ensure consistent environments when using Terraform?
  • What is a workspace in Terraform?
  • What is the primary purpose of Terraform?
  • Which command is used to apply changes required to reach the desired state?
  • What is the correct command to delete a workspace in Terraform?
  • How do you define dependencies between resources in Terraform?
  • What is the scope of local values defined in child modules in Terraform?
  • How do you specify the provider you want to use in Terraform?
  • Which two components can a connection block be nested within?
  • What is the primary purpose of 'terraform import' command?
  • Which command applies changes to the infrastructure as specified in the Terraform configuration files?
  • Which command should you use to ensure a null resource in Terraform re-runs a backup process after script changes?
  • What command would you run to switch to a different workspace in Terraform?
  • What command is used to apply changes in Terraform?
  • In Terraform, what does the 'output' block do?
  • What keyword is used to declare a new module in a Terraform configuration file?
  • What command is used to initialize the backend configuration in Terraform?
  • What is the benefit of implementing Terraform workspaces?
  • What is the purpose of the `terraform state` command?
  • What are provisioners primarily used for in Terraform?
  • How can you override a variable value during execution?
  • What language is used to write Terraform configuration files?
  • How does Terraform determine changes needed for the infrastructure?
  • How does Terraform handle resource dependencies?
  • When would it be appropriate to use a null_resource in Terraform?
  • Which Terraform command is used to initialize a working directory?
  • What distinguishes a map from a list type in Terraform?
  • What command is used to enable a new workspace in Terraform?
  • What is the primary function of a remote backend in Terraform?
  • In Terraform, which file format is typically used for defining infrastructure resources and configurations?
  • Which command outputs the current state of the managed infrastructure?
  • What command do you use to initialize a Terraform configuration?
  • What are the common attributes of a Terraform resource block?
  • What attribute would you use to specify the default value for a variable in Terraform?
  • How do you define dependencies manually if Terraform cannot automatically resolve them?
  • In Terraform, what command would you use to export the state to a JSON file?
  • What is the effect of the 'terraform taint' command?
  • How can a DevOps Engineer expose values from a child module that defines AWS VPC resources to the CLI?
  • What does the command 'terraform state list' do?
  • What does the 'terraform validate' command do?
  • In the provided dynamic block, what is the issue that causes it to result in an error?
  • What file format does Terraform primarily use for its configuration files?
  • What is the difference between 'terraform apply' and 'terraform plan'?
  • Which file extension is commonly used for Terraform files?
  • In Terraform, what does the 'terraform apply' command do?
  • What does the term "Partial configuration" refer to in Terraform?
  • What is the role of 'depends_on' in Terraform modules?
  • Which file type is primarily used for writing Terraform configurations?
  • How would you define a variable in a Terraform configuration file?
  • How can developers inject secrets via Vault at the time of terraform apply within their configuration file?
  • What is the benefit of using 'terraform plan -out'?
  • What is the purpose of the 'terraform validate' command?
  • What is the main purpose of the 'terraform graph' command?
  • What is the primary benefit of using Terraform Cloud?
  • What does the command 'terraform state rm' do?
  • What does the terraform plan command do?
  • Can you write a Terraform configuration that includes both AWS and Azure providers?
  • What does the command 'terraform workspace show' do?
  • Which two languages are typically used in Terraform configurations?
  • What does the 'terraform refresh' command do?
  • What is the primary purpose of a Terraform state file?
  • Is it mandatory to include a provisioner within a resource block when configuring resources in Terraform?
  • What feature in Terraform allows for setting default values for input variables?
  • What does the state locking mechanism in Terraform do?
  • Which of the following tasks is NOT the responsibility of a Terraform provider?
  • How can you prevent sensitive data from being exposed in state files?
  • What does the 'terraform plan' command do?
  • Is Terraform considered open-source software (OSS)?
  • What types of search terms can the Terraform Registry use?
  • Which expression is used to apply the splat operator to return multiple EBS volume IDs?
  • Which of the following is considered an IaC file?
  • What command is used to initialize a new Terraform configuration?
  • What can you do with Terraform Cloud Run Triggers?
  • What is the purpose of the 'terraform plan' command?
  • How can you change the behavior of a resource during lifecycle events?
  • Which of the following is a key feature of Terraform's infrastructure as code?
  • Which feature is NOT available in the free tier of Terraform Cloud?
  • What is a primary benefit of using modules in Terraform?
  • What is a resource in Terraform?
  • What does the Terraform lifecycle block define?
  • Can Terraform be used to manage resources outside of cloud providers?
  • Which Terraform feature allows for finding and managing resource dependencies?
  • What method can be employed to ensure infrastructure changes are reviewed before being applied?
  • What file type does Terraform use for configuration files?
  • What is the use-case for terraform output?
  • What action does 'terraform state mv' perform?
  • To return all the IDs of attached EBS volumes for an AWS virtual machine, which expression should be used?
  • What is a remote backend in Terraform?
  • What benefit does Terraform Cloud provide for team collaboration?
  • Which command is used to view the changes that will be made by applying a Terraform configuration?
  • How do you set up a Terraform backend?
  • How do you extract a list of IDs from a variable named var.list containing a list of objects?
  • What is a provider in Terraform?
  • What does the command 'terraform refresh' do?
  • When Terraform crashes because Golang results in a panic, where will it log the results?
  • Which command saves the execution plan to a file?
  • In Terraform, what is the purpose of `count`?
  • How do you declare a variable in a Terraform configuration?
  • How are variables passed into Terraform configurations?
  • What is a "tainted" resource in Terraform?
  • Which of these Terraform commands is used to clean or remove all associated resources of the current directory?
  • Which command is used to remove Terraform-managed infrastructure?
  • What is the purpose of the 'terraform validate' command?
  • In Terraform, what is an output value?
  • What is the function of a remote backend in Terraform?
  • What command can you use to create an execution plan in Terraform?
  • What is a data source in Terraform?
  • What is a Terraform module?
  • How can variables be set in a Terraform configuration?
  • What does setting the TF_LOG environment variable to DEBUG impact?
  • What is the function of the 'terraform destroy' command?
  • What command is used to apply changes required to reach the desired state of the configuration?
  • How can you maintain idempotency in Terraform configurations?
  • Does the command 'terraform refresh' modify the existing infrastructure?
  • What is the purpose of Terraform modules?
  • Which command lists the workspaces in Terraform?
  • What file is typically used to specify multiple environments in Terraform?
  • Which variable type is most suitable for storing both a server name (string) and memory size (number) in Terraform?
  • What concept allows Terraform to integrate variables and resource attributes together?
  • What is the purpose of the 'terraform fmt' command?
  • Which of the following tasks does terraform init perform?
  • Which of the following is a valid way to refer to a module in Terraform?
  • What does IaC stand for in the context of HashiCorp Terraform?
  • What type of values can variables in Terraform hold?
  • What is the purpose of a Terraform module?
  • What is the purpose of the .terraform.lock.hcl file?
  • Describe the concept of 'resource' in Terraform.
  • What file extension do Terraform configuration files use?
  • Which command is used to initialize a Terraform configuration?
  • How does Terraform determine the correct provider version to use?
  • What functionality does Terraform's `output` variable provide?
  • What does the command 'terraform resource list aws_instance.server' do?
  • Which command would you use to check for discrepancies between the actual infrastructure and your Terraform configuration?
  • How do you target a specific resource when applying changes?
  • What is the safest way to include sensitive variables in a CI/CD pipeline for Terraform?
  • What is the purpose of the 'terraform apply' command?
  • What does the 'terraform apply' command do?
  • What is a workspace in Terraform?
  • Which command is used to create or update infrastructure in Terraform?
  • Which argument must be included in the module block?
  • Which command would you use to see the resources currently being managed in a Terraform state file?
  • What command is primarily used to create or update infrastructure in Terraform?
  • Which command is used to manually mark a resource as tainted in Terraform?
  • Which Terraform command assists in detecting and managing drift?
  • What are variables used for in Terraform?
  • Which command allows you to see anytime your infrastructure will change?
  • In Terraform, what does a module represent?
  • What is the best way to protect sensitive data in Terraform projects?
  • Which method is NOT suitable for keeping secrets out of Terraform configuration files?
  • Which command should you use to view the Terraform state?
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy