The JSON object describing an input variable can now include two additional properties: - "type" provides a JSON representation of the variable's type constraint, if one is set. Omitted if either there is no constraint declared at all or if it's set to "any", which are equivalent and both mean that the type is completely unconstrained. This uses the standard cty representation of a type constraint, which matches how OpenTofu already describes types in the provider protocol, in state snapshots, and in saved plan files. - "required" directly represents whether callers are required to provide a value for the variable. This is technically redundant since it is set to true unless "default" is also set, but this avoids the need for consuming software to reimplement this rule and potentially allows us to make this rule more complicated/subtle in future if needed. For some reason the documentation about the JSON configuration representation did not previously mention the "variables" property at all, so this adds documentation for both the new properties and the pre-existing properties. Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
OpenTofu Documentation
This directory contains the portions of the OpenTofu website that pertain to the core functionality, excluding providers and the overall configuration.
Development server
You can start a local development server with Docker by running the following command from this (the website) directory:
docker compose up --build
The development server will be available on http://localhost:3000/docs/main/ .
Under Docs in the navigation bar, select Development version to see local changes.
Suggesting Changes
You can submit an issue with documentation requests or submit a pull request with suggested changes.
Click Edit this page at the bottom of any OpenTofu website page to go directly to the associated markdown file in GitHub.
Modifying Sidebar Navigation
You must update the sidebar navigation when you add or delete documentation .mdx files. If you do not update the navigation, the website deploy preview fails.
To update the sidebar navigation, you must edit the appropriate nav-data.json file. This repository contains the sidebar navigation files for the following documentation sets:
- OpenTofu Language:
language-nav-data.json - OpenTofu CLI:
cli-nav-data.json - Introduction to OpenTofu:
intro-nav-data.json
Previewing Changes
Currently, you can preview your changes through the opentofu/opentofu.org repository.
Follow the Getting Started guide.
Copyright headers for code examples
In order to not include copyright headers for code examples used in docs, please, add the files under examples folder. This way, it will be ignored on automated copyright headers check.