Which configuration consistency errors does terraform validate report?
Answer(s): C
Terraform validate reports configuration consistency errors, such as declaring a resource identifier more than once. This means that the same resource type and name combination is used for multiple resource blocks, which is not allowed in Terraform. For example, resource "aws_instance" "example" {...} cannot be used more than once in the same configuration. Terraform validate does not report errors related to module versions, state differences, or formatting issues, as these are not relevant for checking the configuration syntax and structure. Reference = [Validate Configuration], [Resource Syntax]
You have used Terraform lo create an ephemeral development environment in the (loud and are now ready to destroy all the Infrastructure described by your Terraform configuration To be safe, you would like to first see all the infrastructure that Terraform will delete.Which command should you use to show all of the resources that mil be deleted? Choose two correct answers.
Answer(s): C,D
fTo see all the resources that Terraform will delete, you can use either of these two commands:terraform destroy will show the plan of destruction and ask for your confirmation before proceeding. You can cancel the command if you do not want to destroy the resources.terraform plan -destroy will show the plan of destruction without asking for confirmation. You can use this command to review the changes before running terraform destroy. Reference = : Destroy Infrastructure : Plan Command: Options
You can configure Terraform to log to a file using the TF_LOG environment variable.
Answer(s): 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. Reference = : Debugging Terraform
When should you run terraform init?
Answer(s): D
You should run terraform init after you start coding a new Terraform project and before you run terraform plan for the first time. This command will initialize the working directory by downloading the required providers and modules, creating the initial state file, and performing other necessary tasks. Reference = : Initialize a Terraform Project
What value does the Terraform Cloud private registry provide over the public Terraform ModuleRegistry?
Answer(s): B
The Terraform Cloud private registry provides the ability to restrict modules to members of Terraform Cloud or Enterprise organizations. This allows you to share modules within your organization without exposing them to the public. The private registry also supports importing modules from your private VCS repositories. The public Terraform Module Registry, on the other hand, publishes modules from public Git repositories and makes them available to any user of Terraform. Reference = : Private Registry - Terraform Cloud : Terraform Registry - Provider Documentation
Post your Comments and Discuss HashiCorp Terraform Associate 004 exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the Terraform Associate 004 content, but please register or login to continue.