00:00

QUESTION 6

Which command add existing resources into Terraform state?

Correct Answer: D
This is the command that can add existing resources into Terraform state, by matching them with the corresponding configuration blocks in your files.

QUESTION 7

You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (* files). You need to enable additional logging messages to find this out. Which of the following would achieve this?

Correct Answer: B
This will enable additional logging messages to find out from which paths Terraform is loading providers referenced in your Terraform configuration files, as it will set the log level to TRACE, which is the most verbose and detailed level.

QUESTION 8

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

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 9

How would you reference the "name???? value of the second instance of this resource?
Terraform-Associate-003 dumps exhibit

Correct Answer: D
In Terraform, when you use the count meta-argument, you can reference individual instances using an index. The indexing starts at 0, so to reference the "name" value of the second instance, you would use aws_instance.web[1].name. This syntax allows you to access the properties of specific instances in a list generated by the count argument.
References:
✑ Terraform documentation on count and accessing resource instances: Terraform Count

QUESTION 10

Why would you use the -replace flag for terraform apply?

Correct Answer: D
The -replace flag is used with the terraform apply command when there is a need to explicitly force Terraform to destroy and then recreate a specific resource during the next apply. This can be necessary in situations where a simple update is insufficient or when a resource must be re-provisioned to pick up certain changes.