nerdexam
HashiCorp

TA-002-P · Question #94

HashiCorp Configuration Language (HCL) supports user-defined functions.

The correct answer is B. False. HCL is a declarative configuration language that provides only built-in functions; user-defined functions are not supported.

Read, generate, and modify configuration

Question

HashiCorp Configuration Language (HCL) supports user-defined functions.

Options

  • ATrue
  • BFalse

How the community answered

(39 responses)
  • A
    5% (2)
  • B
    95% (37)

Why each option

HCL is a declarative configuration language that provides only built-in functions; user-defined functions are not supported.

ATrue

This is false because HCL's specification explicitly excludes user-defined function support; users are limited to the curated set of built-in functions provided by the Terraform runtime.

BFalseCorrect

HashiCorp Configuration Language intentionally omits support for user-defined functions to keep configurations declarative, readable, and free from hidden side effects. All callable functions such as 'merge()', 'lookup()', and 'toset()' are built into the Terraform runtime and cannot be extended or overridden by users. This design constraint prevents configurations from becoming imperative scripts and maintains the language's predictability.

Concept tested: HCL built-in functions and user-defined function restrictions

Source: https://developer.hashicorp.com/terraform/language/functions

Topics

#HCL#Language features#User-defined functions

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice