Terraform-Associate-003 Dumps

Terraform-Associate-003 Free Practice Test

HashiCorp Terraform-Associate-003: HashiCorp Certified: Terraform Associate (003)

QUESTION 1

You can reference a resource created with for_each using a Splat ( *) expression.

Correct Answer: B
You cannot reference a resource created with for_each using a splat (*) expression, as it will not work with resources that have non-numeric keys. You need to use a for expression instead to iterate over the resource instances.

QUESTION 2

You have declared a variable called var.list which is a list of objects that all have an attribute id . Which options will produce a list of the IDs? Choose two correct answers.

Correct Answer: BC
These are two ways to produce a list of the IDs from a list of objects that have an attribute id, using either a for expression or a splat expression syntax.

QUESTION 3

What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?

Correct Answer: A
This is the command that always causes a state file to be updated with changes that might have been made outside of Terraform, as it will only refresh the state file with the current status of the real resources, without making any changes to them or creating a plan.

QUESTION 4

What does state looking accomplish?

Correct Answer: B
This is what state locking accomplishes, by preventing other users from modifying the state file while a Terraform operation is in progress. This prevents conflicts and data loss.

QUESTION 5

When does Sentinel enforce policy logic during a Terraform Cloud run?

Correct Answer: C
Sentinel policies are checked after the plan stage of a Terraform run, but before it can be confirmed or the terraform apply is executed3. This allows you to enforce rules on your infrastructure before it is created or modified.