terraform providers schema command
The terraform providers schema
command print detailed schemas for the providers used in the current configuration.
Usage
The following flags are available:
-json
- Displays the schemas in a machine-readable JSON format. The-json
flag is required.The output includes a
format_version
key, which has a default value of"1.0"
. The semantics of this version are:- Versions between
1.0
and2.0
are backward-compatible. You should ignore any object properties with unrecognized names to remain forward-compatible with future minor versions. - Major versions are not backward-compatible to older versions. You should reject any input that reports an unsupported major version.
- Refer to Terraform 1.0 Compatibility Promises for additional information about version support.
- Versions between
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:
- Providers Schema Representation - the top-level object returned by
terraform providers schema -json
- Schema Representation - a sub-object of providers, resources, and data sources that describes their schema, along with function signatures
- Block Representation - a sub-object of schemas that describes attributes and nested blocks
- Function Representation - a sub-object of functions that describes parameters, the return, and additional documentation
- Parameter Representation - a sub-object of function signatures that describes their type and additional documentation
Providers Schema Representation
Schema Representation
A schema representation pairs a provider or resource schema (in a "block") with that schema's version.
Block Representation
A block representation contains "attributes" and "block_types" (which represent nested blocks).
Function Representation
A function representation describes the definition of a function.
Parameter Representation
A parameter representation describes a parameter to a function.