Over time the discussion about "lifecycle" blocks in the documentation became confusing because the docs originally written for managed resource lifecycle got partially generalized for resources of other modes and for module calls, even though each of those has a completely different lifecycle and thus a different set of lifecycle settings. This is a first pass at trying to reorganize that so that the "lifecycle" page is really just an index of all of the different kinds of lifecycle block that exist in the language, while the main documentation for each use of that block type now belongs with the documentation of the block it's nested within. While working on this I also found that there was some duplication inside the "data sources" page where the same information was described multiple times, and a few other cases where things had become inconsistent over time. This also includes a little extra content to try to clarify the difference between managed, data, and ephemeral resources and to make it explicit that the "Resources" section is focused only on managed resources because that is the primary resource mode. As usual there's lots more that could be done here -- this documentation has gradually evolved over time and is full of weird quirks due to that evolution -- but I decided to draw a line here so that the diff wouldn't get too large. 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.