- OpenTofu Internals
- Functions Metadata
Functions Metadata
The tofu metadata functions
command is used to print signatures for the functions available in the current OpenTofu version.
Usage
Usage: tofu metadata functions [options]
The following flags are available:
-json
- Displays the function signatures in a machine-readable, JSON format.
Please note that, at this time, the -json
flag is a required option. In future releases, this command will be extended to allow for additional options.
The output includes a format_version
key, which has
value "1.0"
. The semantics of this version are:
- We will increment the minor version, e.g.
"1.1"
, for backward-compatible changes or additions. Ignore any object properties with unrecognized names to remain forward-compatible with future minor versions. - We will increment the major version, e.g.
"2.0"
, for changes that are not backward-compatible. Reject any input which reports an unsupported major version.
We will introduce new major versions only within the bounds of the OpenTofu 1.0 Compatibility Promises.
Format Summary
The following sections describe the JSON output format by example, using a pseudo-JSON notation.
Important elements are described with comments, which are prefixed with //
.
To avoid excessive repetition, we've split the complete format into several discrete sub-objects, described under separate headers. References wrapped in angle brackets (like <block-representation>
) are placeholders which, in the real output, would be replaced by an instance of the specified sub-object.
The JSON output format consists of the following objects and sub-objects:
- Function Signature Representation - the top-level object returned by
tofu metadata functions -json
- Parameter Representation - a sub-object of signatures that describes their parameters
Function Signature Representation
Parameter Representation
A parameter representation describes a parameter to a function.