Free HashiCorp Terraform-Associate-003 Exam Actual Questions

The questions for Terraform-Associate-003 were last updated On Nov 16, 2024

Question No. 1

How is terraform import run?

Show Answer Hide Answer
Correct Answer: D

The terraform import command is not part of any other Terraform workflow. It must be explicitly invoked by the user with the appropriate arguments, such as the resource address and the ID of the existing infrastructure to import.

References = [Importing Infrastructure]


Question No. 2

Changing the Terraform backend from the default "local" backend to a different one after performing your first terrafom apply is:

Show Answer Hide Answer
Correct Answer: D

Changing the Terraform backend after performing the initial terraform apply is technically possible but strongly discouraged. This is because changing backends can lead to complexities in state management, requiring manual intervention such as state migration to ensure consistency. Terraform's documentation and best practices advise planning the backend configuration carefully before applying Terraform configurations to avoid such changes.

References = This guidance is consistent with Terraform's official documentation, which recommends careful consideration and planning of backend configurations to avoid the need for changes.


Question No. 3

What type of block is used to construct a collection of nested configuration blocks?

Show Answer Hide Answer
Correct Answer: A

This is the type of block that is used to construct a collection of nested configuration blocks, by using a for_each argument to iterate over a collection value and generate a nested block for each element. For example, you can use a dynamic block to create multiple ingress rules for a security group resource.


Question No. 4

What is the name of the default file where Terraform stores the state?

Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.

Show Answer Hide Answer
Correct Answer: A

The name of the default file where Terraform stores the state is terraform.tfstate. This file contains a JSON representation of the current state of the infrastructure managed by Terraform. Terraform uses this file to track the metadata and attributes of the resources, and to plan and apply changes. By default, Terraform stores the state file locally in the same directory as the configuration files, but it can also be configured to store the state remotely in a backend.

References = [Terraform State], [State File Format]


Question No. 5

When do changes invoked by terraform apply take effect?

Show Answer Hide Answer
Correct Answer: B

Changes invoked by terraform apply take effect once the resource provider has fulfilled the request, not after Terraform has updated the state file or immediately. The state file is only a reflection of the real resources, not a source of truth.