- (Exam Topic 4)
In order to make a Terraform configuration file dynamic and/or reusable, static values should be converted to use what?
Correct Answer:
A
Input variables serve as parameters for a Terraform module, allowing aspects of the module to be customized without altering the module's own source code, and allowing modules to be shared between different configurations.
https://www.terraform.io/docs/configuration/variables.html
- (Exam Topic 4)
Most Terraform providers interact with _____.
Correct Answer:
A
Terraform relies on plugins called "providers" to interact with cloud providers, SaaS providers, and other APIs, as per: https://www.terraform.io/language/providers
- (Exam Topic 2)
What is the default backend for Terraform?
Correct Answer:
C
By default, Terraform uses the "local" backend, which is the normal behavior of Terraform you're used to. https://www.terraform.io/docs/backends/index.html
- (Exam Topic 4)
Select the feature below that best completes the sentence:
The following list represents the different types of ______ available in Terraform.
* 1. max
* 2. min
* 3. join
* 4. replace
* 5. list
* 6. length
* 7. range
Correct Answer:
D
The Terraform language includes a number of built-in functions that you can call from within expressions to transform and combine values. The Terraform language does not support user-defined functions, and only the functions built into the language are available for use.
https://www.terraform.io/docs/configuration/functions.html
- (Exam Topic 1)
Terraform validate reports syntax check errors from which of the following scenarios?
Correct Answer:
B
The terraform validate command is used to validate the syntax of the terraform files. Terraform performs a syntax check on all the terraform files in the directory, and will display an error if any of the files doesn't validate. This command does not check formatting (e.g. tabs vs spaces, newlines, comments etc.). The following can be reported: invalid HCL syntax (e.g. missing trailing quote or equal sign) invalid HCL references (e.g. variable name or attribute which doesn't exist) same provider declared multiple times same module declared multiple times same resource declared multiple times invalid module name interpolation used in places where it's unsupported (e.g. variable, depends_on, module.source, provider) missing value for a variable (none of -var foo=... flag, -var-file=foo.vars flag, TF_VAR_foo environment variable, terraform.tfvars, or default value in the configuration) https://www.typeerror.org/docs/terraform/commands/validate
https://learning-ocean.com/tutorials/terraform/terraform-validate