Terraform Hashicorp Terraform Associate 003 Practice Test - Set 1

Test your knowledge with this Terraform Hashicorp Terraform Associate 003 mock exam. Get real-world IT questions and prepare for certification success.

Terraform Associate 003: HashiCorp Certified Terraform Associate - Exam Information

Exam Information

Exam Code

Terraform Hashicorp Terraform Associate 003

Exam Title

Terraform Associate 003: HashiCorp Certified Terraform Associate

Vendor

HashiCorp

Difficulty

Intermediate

Duration

1 Hour

Question Format

Multiple Choice

Last Updated

February 23, 2025

This certification demonstrates your knowledge of Terraform's basic and advanced features for infrastructure as code.

Practice Test

Shop Best Terraform Associate 003: HashiCorp Certified Terraform Associate Resources Worldwide Amazon

1. What is Terraform primarily used for?

Infrastructure as Code (IaC)
Application Deployment
Continuous Integration
Security Monitoring

2. Which language is used for writing Terraform configuration files?

HCL
YAML
JSON
XML

3. What is the primary command to initialize a new Terraform working directory?

terraform init
terraform apply
terraform plan
terraform refresh

4. Which Terraform command is used to preview changes before applying them?

terraform plan
terraform apply
terraform validate
terraform fmt

5. How does Terraform manage infrastructure state?

Using a state file
By communicating with cloud providers directly
By storing configurations in a database
By using Kubernetes

6. Which backend type does Terraform support for storing state?

S3
Kafka
Redis
MongoDB

7. What is the purpose of the "terraform validate" command?

To check for syntax errors in the configuration
To apply the Terraform configuration
To initialize Terraform plugins
To remove unused resources

8. Which file should be ignored in version control when using Terraform?

terraform.tfstate
main.tf
variables.tf
outputs.tf

9. What is the default provider for Terraform if none is specified?

There is no default provider
AWS
Google Cloud
Azure

10. Which Terraform block is used to define reusable infrastructure components?

module
variable
resource
output

11. How does Terraform handle changes in infrastructure?

It plans and applies incremental changes
It destroys everything and recreates from scratch
It updates only new resources, ignoring changes
It requires manual intervention for all changes

12. Which Terraform command is used to remove infrastructure managed by Terraform?

terraform destroy
terraform apply --destroy
terraform remove
terraform rollback

13. How can you pass variables to a Terraform configuration?

Using a .tfvars file
By embedding values in main.tf
By modifying the terraform binary
By writing values in terraform.tfstate

14. What is the main benefit of using remote state storage in Terraform?

Collaboration and consistency across teams
Faster execution of Terraform plans
Improved debugging
Reduced Terraform file size

15. What is a provider in Terraform?

A plugin that interacts with APIs to manage resources
A configuration file
A security mechanism
A storage backend

16. What is the purpose of the Terraform "output" block?

To display values from Terraform configurations
To define external dependencies
To store intermediate data
To override variable values

17. Which command is used to install required providers and modules in Terraform?

terraform init
terraform get
terraform fetch
terraform install

18. What happens if you run "terraform apply" without running "terraform plan" first?

Terraform will apply changes directly
Terraform will fail
Terraform will always ask for confirmation
Terraform will rollback previous changes

19. How does Terraform handle dependencies between resources?

By automatically determining dependencies
By requiring explicit dependency declarations
By always creating resources in parallel
By running a manual dependency check

20. What does Terraform use to store its state file when working with remote backends?

A remote storage service like S3 or Azure Blob Storage
A local SQLite database
A temporary in-memory cache
A dedicated Terraform server

21. What is the purpose of the "terraform fmt" command?

To format Terraform configuration files consistently
To initialize a new Terraform workspace
To validate Terraform syntax
To apply infrastructure changes

22. What does "terraform refresh" do?

Updates the state file with real infrastructure
Restarts Terraform services
Clears the Terraform cache
Downloads new provider versions

23. Which of these is NOT a valid Terraform workspace command?

terraform workspace create
terraform workspace delete
terraform workspace switch
terraform workspace list

24. What is the purpose of the "depends_on" meta-argument?

To explicitly define resource dependencies
To mark resources for deletion
To specify provider requirements
To control parallel resource creation

25. Which command shows currently installed Terraform providers?

terraform providers
terraform show providers
terraform list providers
terraform get providers

26. What is the purpose of the "count" meta-argument?

To create multiple resource instances
To limit the number of resources created
To count existing resources
To track resource versions

27. Which file extension is commonly used for Terraform variable files?

.tfvars
.tfvar
.tvar
.terraformvars

28. What does the "terraform state list" command do?

Lists resources in the state file
Shows available state backends
Lists previous state versions
Displays state file location

29. Which of these is a valid way to set a variable in Terraform?

All of these
Command line flag
Environment variable
terraform.tfvars file

30. What is the purpose of the "lifecycle" meta-argument?

To control resource creation/destruction behavior
To set resource expiration dates
To manage resource dependencies
To track resource age

31. Which command imports existing infrastructure into Terraform state?

terraform import
terraform state import
terraform get --import
terraform apply --import

32. What is the purpose of the "backend" block in Terraform?

To configure state storage
To define provider settings
To specify resource dependencies
To configure remote operations

33. Which of these is NOT a built-in Terraform function?

to_yaml
merge
lookup
element

34. What does the "terraform taint" command do?

Marks a resource for recreation
Removes a resource from state
Shows problematic resources
Validates resource configuration

35. Which meta-argument is used to conditionally create resources?

count
for_each
depends_on
Both count and for_each

36. What is the purpose of the "locals" block?

To define local variables
To specify resource locations
To configure provider regions
To limit resource scope

37. Which command shows the execution plan from a saved plan file?

terraform show
terraform plan --show
terraform display
terraform output plan

38. What is the purpose of the "required_version" setting?

To specify Terraform version constraints
To set the minimum resource version
To force provider updates
To declare module versions

39. Which of these is a valid state manipulation command?

terraform state mv
terraform modify state
terraform update state
terraform state edit

40. What does the "ignore_changes" lifecycle argument do?

Prevents certain attributes from triggering updates
Skips resource validation
Disables state tracking
Ignores dependency changes

41. Which command upgrades modules and providers?

terraform init -upgrade
terraform upgrade
terraform get -update
terraform update

42. What is the purpose of the "terraform_remote_state" data source?

To access outputs from other state files
To manage remote backends
To sync state files
To validate remote configurations

43. Which meta-argument is used to create multiple similar resources?

for_each
multiple
replicate
with_items

44. What is the purpose of the "prevent_destroy" lifecycle argument?

To safeguard critical resources from deletion
To stop all destroy operations
To require manual confirmation for destroys
To log destruction attempts

45. Which command removes items from the state file?

terraform state rm
terraform remove
terraform delete
terraform state delete

46. What is the purpose of the "sensitive" argument for variables?

To hide values in CLI output
To encrypt variable values
To restrict variable usage
To mark variables as required

47. Which command saves a plan to a file?

terraform plan -out=filename
terraform save-plan filename
terraform plan --save filename
terraform export plan filename

48. What is the purpose of the "dynamic" block?

To generate multiple nested blocks dynamically
To create resources that change over time
To handle variable resource counts
To manage state transitions

49. Which command applies a saved plan file?

terraform apply planfile
terraform plan --apply planfile
terraform execute planfile
terraform run planfile

50. What is the purpose of the "replace" option in terraform plan?

To force replacement of specific resources
To update resource dependencies
To swap module versions
To change state backends

51. Which file is used to lock provider versions?

.terraform.lock.hcl
providers.lock
versions.tf
terraform.lock

52. What is the purpose of the "null_resource"?

To run provisioners without a real resource
To represent empty values
To skip resource creation
To test Terraform configurations

53. Which command shows resource attributes from state?

terraform state show
terraform show state
terraform inspect
terraform attributes

54. What is the purpose of the "templatefile" function?

To render files with template syntax
To generate configuration files
To manage file templates
To create module templates

55. Which of these is a valid provisioner?

local-exec
shell-run
command-exec
remote-cmd

56. What is the purpose of the "timeouts" block?

To configure operation time limits
To schedule resource creation
To delay resource provisioning
To track resource duration

57. Which command shows the current workspace?

terraform workspace show
terraform show workspace
terraform current-workspace
terraform workspace current

58. What is the purpose of the "external" data source?

To integrate with external programs
To reference outside infrastructure
To import external configurations
To manage cross-account resources

59. Which meta-argument controls resource creation order?

depends_on
create_order
sequence
before

60. What is the purpose of the "terraform graph" command?

To visualize resource dependencies
To show provider relationships
To display module hierarchy
To map workspace connections

The Terraform Hashicorp Terraform Associate 003 certification is a globally recognized credential for IT professionals. This practice test helps you prepare by covering key topics like hardware, networking, troubleshooting, and security.

Want more practice? Check out our other mock exams:

© 2025 ITCertRocket.com - Hands-On IT Lab Exercises & Certification Prep. All rights reserved.