Question 70
Consider a workflow where a data-platform team must give a provider a JSON policy document generated from HCL values. What Terraform feature solves that specific problem?
Explanation
Correct Answer
Jsonencode safely produces JSON from Terraform expressions. This meets the stated requirement to give a provider a JSON policy document generated from HCL values.
Incorrect Answers
split function is intended to convert a delimited input string into a list of individual names; split is the inverse operation of joining a delimiter-separated string. That is not the specific requirement to give a provider a JSON policy document generated from HCL values.
Conditional expression with ?: is intended to choose a larger instance type only for a production environment; Terraform conditionals select values without separate imperative branches. That is not the specific requirement to give a provider a JSON policy document generated from HCL values.
format function is intended to interpolate a region and numeric index into a consistent server name; format builds strings using format specifiers. That is not the specific requirement to give a provider a JSON policy document generated from HCL values.






HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests