Question 13

Which of the following is not a valid Terraform variable type?

Correct Answer:B
This is not a valid Terraform variable type. The other options are valid variable types that can store different kinds of values2.

Question 14

Which provider authentication method prevents credentials from being stored in the state file?

Correct Answer:D
None of the above methods prevent credentials from being stored in the state file. Terraform stores the provider configuration in the state file, which may include sensitive information such as credentials. This is a potential security risk and should be avoided if possible. To prevent credentials from being stored in the state file, you can use one of the following methods:
✑ Use environment variables to pass credentials to the provider. This way, the credentials are not part of the provider configuration and are not stored in the state file. However, this method may not work for some providers that require credentials to be set in the provider block.
✑ Use dynamic credentials to authenticate with your cloud provider. This way,
Terraform Cloud or Enterprise will request temporary credentials from your cloud provider for each run and use them to provision your resources. The credentials are not stored in the state file and are revoked after the run is completed. This method is supported for AWS, Google Cloud Platform, Azure, and
Vault. References = : [Sensitive Values in State] : Authenticate providers with dynamic credentials

Question 15

You can access state stored with the local backend by using terraform_remote_state data source.

Correct Answer:B
You cannot access state stored with the local backend by using the terraform_remote_state data source. The terraform_remote_state data source is used to retrieve the root module output values from some other Terraform configuration using the latest state snapshot from the remote backend. It requires a backend that supports remote state storage, such as S3, Consul, AzureRM, or GCS. The local backend stores the state file locally on the filesystem, which terraform_remote_state cannot access. References:
✑ Terraform documentation on terraform_remote_state data source: Terraform
Remote State Data Source
✑ Example usage of remote state: Example Usage (remote Backend)

Question 16

Which of these are features of Terraform Cloud? Choose two correct answers.

Correct Answer:AD
Terraform Cloud includes several features designed to enhance collaboration and infrastructure management. Two of these features are:
✑ A web-based user interface (UI): This allows users to interact with Terraform Cloud
through a browser, providing a centralized interface for managing Terraform configurations, state files, and workspaces.
✑ Remote state storage: This feature enables users to store their Terraform state
files remotely in Terraform Cloud, ensuring that state is safely backed up and can be accessed by team members as needed.

Question 17

You can configure Terraform to log to a file using the TF_LOG environment variable.

Correct Answer:A
You can configure Terraform to log to a file using the TF_LOG environment variable. This variable can be set to one of the log levels: TRACE, DEBUG, INFO, WARN or ERROR. You can also use the TF_LOG_PATH environment variable to specify a custom log file location. References = : Debugging Terraform

Question 18

Which of the following is not a benefit of adopting infrastructure as code?

Correct Answer:B
Infrastructure as Code (IaC) provides several benefits, including the ability to version control infrastructure, reuse code, and automate infrastructure management. However, IaC is typically associated with declarative configuration files and does not inherently provide a graphical user interface (GUI). A GUI is a feature that may be provided by specific tools or platforms built on top of IaC principles but is not a direct benefit of IaC itself1.
References = The benefits of IaC can be verified from the official HashiCorp documentation
on ??What is Infrastructure as Code with Terraform??? provided by HashiCorp Developer1.

START Terraform-Associate-003 EXAM