TA-002-P Dumps

TA-002-P Free Practice Test

HashiCorp TA-002-P: HashiCorp Certified: Terraform Associate

QUESTION 56

- (Exam Topic 3)
A user has created three workspaces using the command line - prod, dev, and test. The user wants to create a fourth workspace named stage. Which command will the user execute to accomplish this?

Correct Answer: A
The terraform workspace new command is used to create a new workspace. https://www.terraform.io/docs/commands/workspace/new.html

QUESTION 57

- (Exam Topic 4)
What does terraform destroy do?

Correct Answer: A
The terraform destroy command terminates resources managed by your Terraform project. This command is the inverse of terraform apply in that it terminates all the resources specified in your Terraform state. It does not destroy resources running elsewhere that are not managed by the current Terraform project. https://learn.hashicorp.com/tutorials/terraform/aws-destroy

QUESTION 58

- (Exam Topic 1)
When you initialize Terraform, where does it cache modules from the public Terraform Module Registry?

Correct Answer: C

"A hidden .terraform directory, which Terraform uses to manage cached provider plugins and modules, record which workspace is currently active, and record the last known backend configuration in case it needs to migrate state on the next run. This directory is automatically managed by Terraform, and is created during initialization." https://www.terraform.io/cli/init

QUESTION 59

- (Exam Topic 3)
Refer to the following terraform variable definition
variable "track_tag" { type = list default = ["data_ec2","integration_ec2","digital_ec2"]} track_tag = { Name = element(var.track_tag,count.index)}
If count.index is set to 2, which of the following values will be assigned to the name attribute of track_tag variable?

Correct Answer: B

QUESTION 60

- (Exam Topic 1)
How would you reference the "name" value of the second instance of this fictitious resource?
TA-002-P dumps exhibit

Correct Answer: B
https://www.terraform.io/language/meta-arguments/count#referring-to-instances Reference: https://www.terraform.io/docs/configuration-0-11/interpolation.html