Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 249

You are creating a reusable Terraform configuration and want to include a billing_dept tag so your Finance team can track team-specific spending on resources. Which of the following billing_dept variable declarations will allow you to do this?

    Correct Answer: C

    To include a billing_dept tag for tracking team-specific spending on resources in Terraform, you can make the variable optional by providing a default value. Setting the default value to an empty string, as shown in option C, achieves this. This way, if no value is provided, the variable will default to an empty string, enabling the Finance team to optionally track spending without errors. Other options listed either contain invalid properties or syntax, making them unsuitable for this purpose.

Discussion
sdm13168Option: C

tested, got error for A. But C verifed

Oleg_golOption: B

variable "billing_dept "{ type = optional(string) }

szyd3rca

│ Error: Invalid type specification │ │ on main.tf line 15, in variable "billing_dept": │ 15: type = optional(string) │ │ Keyword "optional" is valid only as a modifier for object type attributes.

Ni33Option: C

C is the correct answer. Tested and verified.

Ni33Option: C

C is the correct option. All the arguments of variables are optional. A - optional is not a valid argument. B- optional(string) is not a valid argument value. D - default is not a valid argument value.

SimplonOption: C

Tested. All other answers returned an error.javascript:void(0)

Simplon

*Tested. All other answers returned an error. (the javascript:void(0) is a typing mistake on my part).

halfwayOption: C

It is C, optional, any data type is acceptable.

JhaggarOption: B

type = optional(string)