Free TA-002-P Exam Braindumps

Pass your HashiCorp Certified: Terraform Associate exam with these free Questions and Answers

Page 12 of 19
QUESTION 51

- (Exam Topic 2)
Which Terraform command will force a marked resource to be destroyed and recreated on the next apply?

  1. A. terraform fmt
  2. B. terraform destroy
  3. C. terraform taint
  4. D. terraform refresh

Correct Answer: C
The terraform taint command manually marks a Terraform-managed resource as tainted, forcing it to be destroyed and recreated on the next apply.
This command will not modify infrastructure, but does modify the state file in order to mark a resource as tainted. Once a resource is marked as tainted, the next plan will show that the resource will be destroyed and recreated and the next apply will implement this change.
Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not visible in the attributes of a resource. For example: re-running provisioners will cause the node to be different or rebooting the machine from a base image will cause new startup scripts to run.
Note that tainting a resource for recreation may affect resources that depend on the newly tainted resource. For example, a DNS resource that uses the IP address of a server may need to be modified to reflect the potentially new IP address of a tainted server. The plan command will show this if this is the case.
https://www.terraform.io/docs/commands/taint.html

QUESTION 52

- (Exam Topic 1)
Terraform and Terraform providers must use the same major version number in a single configuration.

  1. A. True
  2. B. False

Correct Answer: B
https://www.terraform.io/language/expressions/version-constraints#terraform-core-and-provider-versions

QUESTION 53

- (Exam Topic 4)
In order to reduce the time it takes to provision resources, Terraform uses parallelism. By default, how many resources will Terraform provision concurrently?

  1. A. 5
  2. B. 50
  3. C. 10
  4. D. 20

Correct Answer: C

QUESTION 54

- (Exam Topic 3)
You have created an AWS EC2 instance of type t2.micro through your terraform configuration file ec2.tf . Now you want to change the instance type from t2.micro to t2.medium. Accordingly you have changed your configuration file and and ran terraform plan. After running terraform plan you check the output and saw one instance will be updated from t2.micro --> t2.medium. After this you went to grab a coffee without running terraform apply and meanwhile a member of your team changed the instance type of that EC2 instance to t2.medium from aws console. After coming to your desk you run terraform apply. What will happen?

  1. A. No resource will be updated and you will see the message : Apply Complete ! Resources : 0 added, 0 changed, 0 destroyed.
  2. B. The instance type will be changed to t2.micro and again will be changed to t2.medium
  3. C. terraform apply will through an error.
  4. D. 1 resource will be updated and you will see the message : Apply Complete ! Resources : 0 added, 1 changed, 0 destroyed.

Correct Answer: A

QUESTION 55

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

  1. A. element(aws_instance.web, 2)
  2. B. aws_instance.web[1].name
  3. C. aws_instance.web[1]
  4. D. aws_instance.web[2].name
  5. E. aws_instance.web.*.name

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

Page 12 of 19

Post your Comments and Discuss HashiCorp TA-002-P exam with other Community members: