Which of the following value will be accepted for my_var?
1. variable "my_var"
2. {
3. type = string
4. }
C
Explanation:
The Terraform language will automatically convert number and bool values to string values when
needed, and vice-versa as long as the string contains a valid representation of a number or boolean
value.
Example
* true converts to "true", and vice-versa
* false converts to "false", and vice-versa
* 15 converts to "15", and vice-versa
Where possible, Terraform automatically converts values from one type to another in order to
produce the expected type. If this isn't possible, Terraform will produce a type mismatch error and
you
must
update
the
configuration with a more suitable expression.
https://www.terraform.io/docs/configuration/expressions.html#type-conversion
The variable my_var is defined with a type = string, which means it expects a value of type string. The value 15 (without quotes) is a number, not a string, so it would not be valid. However, "15" (with quotes) is a string and would be accepted.
So, only the string "15" is valid for the my_var variable.