Free Terraform Associate Exam Braindumps (page: 16)

Page 15 of 113

How would you reference the "name" value of the second instance of this fictitious resource?

  1. element(aws_instance.web, 2)
  2. aws_instance.web[1].name
  3. aws_instance.web[1]
  4. aws_instance.web[2].name
  5. aws_instance.web.*.name

Answer(s): B


Reference:

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



A Terraform provider is not responsible for:

  1. Understanding API interactions with some service
  2. Provisioning infrastructure in multiple clouds
  3. Exposing resources and data sources based on an API
  4. Managing actions to take based on resource differences

Answer(s): B


Reference:

https://www.terraform.io/language/providers



Terraform provisioners can be added to any resource block.

  1. True
  2. False

Answer(s): A

Explanation:

As you continue learning about Terraform, you will start hearing about provisioners. Terraform provisioners can be created on any resource and provide a way to execute actions on local or remote machines.


Reference:

https://www.phillipsj.net/posts/introduction-to-terraform-provisioners/
https://www.terraform.io/language/resources/provisioners/local-exec



What is terraform refresh intended to detect?

  1. Terraform configuration code changes
  2. Empty state files
  3. State file drift
  4. Corrupt state files

Answer(s): C

Explanation:

"The terraform refresh command reads the current settings from all managed remote objects and updates the Terraform state to match. Warning: This command is deprecated, because its default behavior is unsafe if you have misconfigured credentials for any of your providers. See below for more information and recommended alternatives."


Reference:

https://www.terraform.io/cli/commands/refresh






Post your Comments and Discuss HashiCorp Terraform Associate exam with other Community members:

Terraform Associate Discussions & Posts