What does Terraform use the .terraform.lock.hc1 file for?
Answer(s): B
The .terraform.lock.hcl file is a new feature in Terraform 0.14 that records the exact versions of each provider used in your configuration. This helps ensure consistent and reproducible behavior across different machines and runs.
Why does this backend configuration not follow best practices?
Answer(s): C
This is a bad practice, as it exposes your credentials to anyone who can access your configuration files or state files. You should use environment variables, credential files, or other mechanisms to provide credentials to Terraform.
Module variable assignments are inherited from the parent module and you do not need to explicitly set them.
Module variable assignments are not inherited from the parent module and you need to explicitly set them using the source argument. This allows you to customize the behavior of each module instance.
What does Terraform not reference when running a terraform apply -refresh-only ?
Answer(s): D
When running a terraform apply -refresh-only, Terraform does not reference the configuration files, but only the state file, credentials, and cloud provider. The purpose of this command is to update the state file with the current status of the real resources, without making any changes to them1.
Which of the following is not a valid Terraform variable type?
This is not a valid Terraform variable type. The other options are valid variable types that can store different kinds of values2.
Post your Comments and Discuss HashiCorp Terraform Associate 004 exam prep with other Community members: