- The Command Line
- Basic CLI Features
- Command: providers
- Command: providers schema
Command: providers schema
The tofu providers schema
command is used to print detailed schemas for the providers used in the current configuration.
Usage
Usage: tofu providers schema [options]
Use of variables in module sources,
backend configuration,
or encryption block
requires assigning values to root module variables
when running tofu providers schema
.
The following flags are available:
-
-json
- Displays the schemas in a machine-readable, JSON format. -
-var 'NAME=VALUE'
- Sets a value for a single input variable declared in the root module of the configuration. Use this option multiple times to set more than one variable. Refer to Input Variables on the Command Line for more information. -
-var-file=FILENAME
- Sets values for potentially many input variables declared in the root module of the configuration, using definitions from a "tfvars" file. Use this option multiple times to include values from more than one file.
There are several other ways to set values for input variables in the root
module, aside from the -var
and -var-file
options. Refer to
Assigning Values to Root Module Variables for more information.
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:
- Providers Schema Representation - the top-level object returned by
tofu providers schema -json
- Schema Representation - a sub-object of providers, resources, and data sources that describes their schema
- Block Representation - a sub-object of schemas that describes attributes and nested blocks
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).