You have to initialize a Terraform backend before it can be configured.
Answer(s): B
You can configure a backend in your Terraform code before initializing it. Initializing a backend will store the state file remotely and enable features like locking and workspaces. Reference = [Terraform Backends]
You've used Terraform to deploy a virtual machine and a database. You want to replace this virtual machine instance with an identical one without affecting the database. What is the best way to achieve this using Terraform?
The terraform taint command marks a resource as tainted, which means it will be destroyed and recreated on the next apply. This way, you can replace the VM instance without affecting the database or other resources. Reference = [Terraform Taint]
How would you output returned values from a child module in the Terraform CLI output?
Answer(s): C
To output returned values from a child module in the Terraform CLI output, you need to declare the output in both the child module and the root module. The child module output will return the value to the root module, and the root module output will display the value in the CLI. Reference = [Terraform Outputs]
If a module declares a variable with a default, that variable must also be defined within the module.
A module can declare a variable with a default value without requiring the caller to define it. This allows the module to provide a sensible default behavior that can be customized by the caller if needed. Reference = [Module Variables]
Post your Comments and Discuss HashiCorp Terraform-Associate-003 exam with other Community members:
Marc commented on October 18, 2024 What the best way to learn terraform? UNITED STATES upvote
Chandra commented on October 09, 2024 This is the best and only way of passing this exam as it is extremely hard. Good questions and valid dump. INDIA upvote
Madhan commented on September 26, 2024 Useful questions INDIA upvote
Abu commented on September 22, 2024 I did not know these questions were available online. I did not believe and trust them and studied quite a lot and just used these questions for practice. But most of the questions turned out to be in the exam. UNITED STATES upvote
Sahin commented on July 04, 2024 Need que to learn new things UNITED STATES upvote
Our website is free, but we have to fight against bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the Terraform-Associate-003 content, but please register or login to continue.