HashiCorp Terraform Associate 003 Practice Test - Questions Answers, Page 5
Related questions
Question 41
What type of block is used to construct a collection of nested configuration blocks?
Explanation:
This is the type of block that is used to construct a collection of nested configuration blocks, by using afor_eachargument to iterate over a collection value and generate a nested block for each element. For example, you can use a dynamic block to create multiple ingress rules for a security group resource.
Question 42
You are using a networking module in your Terraform configuration with the name label my-network. In your main configuration you have the following code:
When you run terraform validate, you get the following error:
What must you do to successfully retrieve this value from your networking module?
Explanation:
This is what you must do to successfully retrieve this value from your networking module, as it will expose the attribute as an output value that can be referenced by other modules or resources. The error message indicates that the networking module does not have an output value namedvnet_id, which causes the reference to fail.
Question 43
Where does the Terraform local backend store its state?
Explanation:
This is where the Terraform local backend stores its state, by default, unless you specify a different file name or location in your configuration. The local backend is the simplest backend type that stores the state file on your local disk.
Question 44
Where can Terraform not load a provider from?
Explanation:
This is where Terraform cannot load a provider from, as it requires a compiled binary file that implements the provider protocol. You can load a provider from a plugins directory, a provider plugin cache, or the official HashiCorp distribution on releases.hashicorp.com.
Question 45
You modified your Terraform configuration and run Terraform plan to review the changes. Simultaneously, your teammate manually modified the infrastructure component you are working on. Since you already ran terraform plan locally, the execution plan for terraform apply will be the same.
Explanation:
The execution plan forterraform applywill not be the same as the one you ran locally withterraform plan, if your teammate manually modified the infrastructure component you are working on. This is because Terraform will refresh the state file before applying any changes, and will detect any differences between the state and the real resources.
Question 46
Which parameters does terraform import require? Choose two correct answers.
Explanation:
These are the parameters thatterraform importrequires, as they allow Terraform to identify the existing resource that you want to import into your state file, and match it with the corresponding configuration block in your files.
Question 47
In a Terraform Cloud workpace linked to a version control repository speculative plan rum start automatically commit changes to version control.
Explanation:
When you use a remote backend that needs authentication, HashiCorp recommends that you:
Question 48
A Terraform provider is NOT responsible for:
Explanation:
This is not a responsibility of a Terraform provider, as it does not make sense grammatically or logically. A Terraform provider is responsible for exposing resources and data sources based on an API, managing actions to take based on resource differences, and understanding API interactions with some service.
Question 49
When using multiple configuration of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?
Explanation:
This is the meta-argument that you must include in any non-default provider configurations, as it allows you to give a friendly name to the configuration and reference it in other parts of your code. The other options are either invalid or irrelevant for this purpose.
Question 50
Terraform variable names are saved in the state file.
Explanation:
Terraform variable names are not saved in the state file, only their values are. The state file only stores the attributes of the resources and data sources that are managed by Terraform, not the variables that are used to configure them.
Question