Question 380
A regional operations group wants to construct a comma-delimited environment variable from a list of service names. Which of the following is the most appropriate Terraform capability?
Explanation
Correct Answer
Join combines list elements into a delimited string. This meets the stated requirement to construct a comma-delimited environment variable from a list of service names.
Incorrect Answers
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 construct a comma-delimited environment variable from a list of service names.
templatefile function is intended to fill placeholders in a separate file of startup configuration text; templatefile generates text from a file and explicit variables. That is not the specific requirement to construct a comma-delimited environment variable from a list of service names.
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 construct a comma-delimited environment variable from a list of service names.






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