Oracle Cloud Infrastructure 2019 Developer Associate — Question 117
Which does NOT set a variable in Terraform?
Answer options
- A. Passing the variable with a var statement to Terraform
- B. Setting the variable as key value pairs in a file in a subdirectory named tfvar
- C. A default value in the variable declaration within a TF plan file
- D. Setting the environment variable using a TF_VAR_ predicate in front of the variable name
Correct answer: A
Explanation
Option A is the correct answer because passing a variable with a var statement does not actually set the variable; it is used to reference variables that have already been defined. The other options describe valid methods for setting variables in Terraform, such as through key value pairs in files, default values in declarations, and environment variables with the TF_VAR_ prefix.