Question 43

- (Exam Topic 4)
Which statements best describes what the local variable assignment is doing in the following code snippet:

Correct Answer:D

Question 44

- (Exam Topic 3)
If you delete a remote backend from the configuration, will you need to rebuild your state files locally?

Correct Answer:A
You can change your backend configuration at any time. You can change both the configuration itself as well as the type of backend (for example from "consul" to "s3").
Terraform will automatically detect any changes in your configuration and request a reinitialization. As part of the reinitialization process, Terraform will ask if you'd like to migrate your existing state to the new configuration. This allows you to easily switch from one backend to another.
https://www.terraform.io/docs/backends/config.html#changing-configuration

Question 45

- (Exam Topic 4)
True or False? By default, Terraform destroy will prompt for confirmation before proceeding.

Correct Answer:B

Question 46

- (Exam Topic 4)
Which of the following is not a way to trigger terraform destroy ?

Correct Answer:A

Question 47

- (Exam Topic 4)
You can reference a resource created with for_each using a Splat (*) expression.

Correct Answer:B
Splat Expressions with Maps The splat expression patterns shown above apply only to lists, sets, and tuples. To get a similar result with a map or object value you must use for expressions. Resources that use the for_each argument will appear in expressions as a map of objects, so you can't use splat expressions with those resources. For more information, see Referring to Resource Instances. https://www.terraform.io/language/meta-arguments/for_each#referring-to-instances
https://www.terraform.io/language/expressions/references

Question 48

- (Exam Topic 4)
To check if all code in a Terraform configuration with multiple modules is properly formatted without making changes, what command should be run?

Correct Answer:D
-check Check if the input is formatted. Exit status will be 0 if all input is properly formatted and non-zero otherwise.
-recursive Also process files in subdirectories. By default, only the given directory (or current directory) is processed.

START TA-002-P EXAM