Free TA-002-P Exam Braindumps

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

Page 25 of 19
QUESTION 116

- (Exam Topic 4)
Given the below resource configuration - resource "aws_instance" "web" { # ... count = 4 }
What does the terraform resource address aws_instance.web refer to?

  1. A. It refers to all 4 web instances , together , for further individual segregation , indexing is required , with a 0 based index.
  2. B. It refers to the last web EC2 instance , as by default , if no index is provided , the last / N-1 index is used.
  3. C. It refers to the first web EC2 instance out of the 4 ,as by default , if no index is provided , the first / 0th index is used.
  4. D. The above will result in a syntax error , as it is not syntactically correct . Resources defined using count , can only be referenced using indexes.

Correct Answer: A
A Resource Address is a string that references a specific resource in a larger infrastructure. An address is made up of two parts:
[module path][resource spec] Module path:
A module path addresses a module within the tree of modules. It takes the form: module.A.module.B.module.C...
Multiple modules in a path indicate nesting. If a module path is specified without a resource spec, the address applies to every resource within the module. If the module path is omitted, this addresses the root module.
Given a Terraform config that includes: resource "aws_instance" "web" {
# ...
count = 4
}
An address like this: aws_instance.web[3]
Refers to only the last instance in the config, and an address like this: aws_instance.web
Refers to all four "web" instances. https://www.terraform.io/docs/internals/resource-addressing.html

QUESTION 117

- (Exam Topic 2)
lookup retrieves the value of a single element from which of the below data type?

  1. A. map
  2. B. set
  3. C. string
  4. D. list

Correct Answer: A
https://www.terraform.io/docs/configuration/functions/lookup.html

QUESTION 118

- (Exam Topic 4)
Which parameters does terraform import require? Choose two correct answers.

  1. A. Provider
  2. B. Path
  3. C. Resource address
  4. D. Resource ID

Correct Answer: CD
https://www.terraform.io/cli/commands/import#usage

QUESTION 119

- (Exam Topic 4)
To check if all code in a Terraform configuration with multiple modules is properly formatted without making changes, what command should be run?

  1. A. terraform fmt -check
  2. B. terraform fmt -write-false
  3. C. terraform fmt "list -recursive
  4. D. terraform fmt -check -recursive

Correct Answer: D
-check Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise.
-recursive Also process files in subdirectories. By default, only the given directory (or current directory) is processed.

Page 25 of 19

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