HashiCorp Terraform Associate 003 Practice Test - Questions Answers, Page 12
List of questions
Question 111
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What is the workflow for deploying new infrastructure with Terraform?
Explanation:
This is the workflow for deploying new infrastructure with Terraform, as it will create a plan and apply it to the target environment. The other options are either incorrect or incomplete.
Question 112
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
Select the command that doesn't cause Terraform to refresh its state.
Explanation:
This is the command that does not cause Terraform to refresh its state, as it only lists the resources that are currently managed by Terraform in the state file. The other commands will refresh the state file before performing their operations, unless you use the-refresh=falseflag.
Question 113
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
Which command lets you experiment with terraform expressions?
Explanation:
This is the command that lets you experiment with Terraform expressions, by providing an interactive console that allows you to evaluate expressions and see their results. You can use this command to test your expressions before using them in your configuration files.
Question 114
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
If a DevOps team adopts AWS CloudFormation as their standardized method for provisioning public cloud resoruces, which of the following scenarios poses a challenge for this team?
Explanation:
This is the scenario that poses a challenge for this team, if they adopt AWS CloudFormation as their standardized method for provisioning public cloud resources, as CloudFormation only supports AWS services and resources, and cannot be used to provision infrastructure on other cloud platforms such as Azure.
Question 115
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
When using a remote backend or terraform Cloud integration, where does Terraform save resource sate?
Explanation:
This is where Terraform saves resource state when using a remote backend or Terraform Cloud integration, as it allows you to store and manage your state file in a remote location, such as a cloud storage service or Terraform Cloud's servers. This enables collaboration, security, and scalability for your Terraform infrastructure.
Question 116
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
You add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The existing and new resources use the same provider. The working contains a .terraform.lock, hc1 file.
How will Terraform choose which version of the provider to use?
Explanation:
This is how Terraform chooses which version of the provider to use, when you add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The lock file records the exact version of each provider that was installed in your working directory, and ensures that Terraform will always use the same provider versions until you runterraform init -upgradeto update them.
Question 117
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
What is a key benefit of the Terraform state file?
Explanation:
This is a key benefit of the Terraform state file, as it stores and tracks the metadata and attributes of the resources that are managed by Terraform, and allows Terraform to compare the current state with the desired state expressed by your configuration files.
Question 118
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
You have to initialize a Terraform backend before it can be configured.
Explanation:
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]
Question 119
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
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?
Explanation:
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]
Question 120
![Export Export](https://examgecko.com/assets/images/icon-download-24.png)
How would you output returned values from a child module in the Terraform CLI output?
Explanation:
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]
Question