HashiCorp TA-002-P HashiCorp Certified: Terraform Associate Online Training
HashiCorp TA-002-P Online Training
The questions for TA-002-P were last updated at Jan 12,2025.
- Exam Code: TA-002-P
- Exam Name: HashiCorp Certified: Terraform Associate
- Certification Provider: HashiCorp
- Latest update: Jan 12,2025
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 plan 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.
D
Explanation:
Reference:
https://www.google.com/search?q=Write+a+Terraform+configuration%2C+run+terraform+init%2C
+run+terraform+plan+to+view+planned+infrastructure+changes%2C+and+terraform+apply +to+create+new
+infrastructure.&oq=Write+a+Terraform+configuration%2C+run+terraform+init%2C+run+te rraform+plan+to
+view+planned+infrastructure+changes%2C+and+terraform+apply+to+create+new
+infrastructure.&aqs=chrome..69i57.556j0j7&sourceid=chrome&ie=UTF-8
You have used Terraform to create an ephemeral development environment in the cloud and are now ready to destroy all the infrastructure described by your Terraform configuration. To be safe, you would like to first see all the infrastructure that will be deleted by Terraform.
Which command should you use to show all of the resources that will be deleted? (Choose two.)
- A . Run terraform plan -destroy.
- B . This is not possible. You can only show resources that will be created.
- C . Run terraform state rm *.
- D . Run terraform destroy and it will first output all the resources that will be deleted before prompting for approval.
A,D
Explanation:
Reference: https://www.terraform.io/docs/cli/commands/state/rm.html
What features does the hosted service Terraform Cloud provide? (Choose two.)
- A . Automated infrastructure deployment visualization
- B . Automatic backups
- C . Remote state storage
- D . A web-based user interface (UI)
C,D
Explanation:
https://www.terraform.io/enterprise/admin/infrastructure/backup-restore
Only the user that generated a plan may apply it.
- A . True
- B . False
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
A
Explanation:
https://www.terraform.io/cli/commands/taint
Which of the following is not a valid string function in Terraform?
- A . split
- B . join
- C . slice
- D . chomp
C
Explanation:
https://www.terraform.io/language/functions
terraform validate validates the syntax of Terraform files.
- A . True
- B . False
A
Explanation:
https://www.terraform.io/cli/commands/validate
The terraform validate command validates the syntax and arguments of the Terraform configuration files.
Reference: https://www.terraform.io/docs/cli/code/index.html
One remote backend configuration always maps to a single remote workspace.
- A . True
- B . False
B
Explanation:
The remote backend can work with either a single remote Terraform Cloud workspace, or with multiple similarly-named remote workspaces (like networking-dev and networking-prod). The workspaces block of the backend configuration determines which mode it uses: To use a single remote Terraform Cloud workspace, set workspaces.name to the remote workspace’s full name (like networking-prod). To use multiple remote workspaces, set workspaces.prefix to a prefix used in all of the desired remote workspace names. For example, set prefix = "networking-" to use Terraform cloud workspaces with names like networking-dev and networking-prod. This is helpful when mapping multiple Terraform CLI workspaces used in a single Terraform configuration to multiple Terraform Cloud workspaces.
A Terraform local value can reference other Terraform local values.
- A . True
- B . False
A
Explanation:
"The expressions in local values are not limited to literal constants; they can also reference other values in the module in order to transform or combine them, including variables, resource attributes, or other local values:" https://www.terraform.io/language/values/locals#declaring-a-local-value
Terraform providers are always installed from the Internet.
- A . True
- B . False
B
Explanation:
Terraform configurations must declare which providers they require, so that Terraform can install and use them.
Reference: https://www.terraform.io/docs/language/providers/configuration.html