Commit Graph

233 Commits

Author SHA1 Message Date
Ilia Gogotchuri
fd19a3763f Retain resource instances with a new lifecycle argument - destroy (#3409)
Signed-off-by: Ilia Gogotchuri <ilia.gogotchuri0@gmail.com>
Co-authored-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-12-04 18:49:57 +04:00
Martin Atkins
82fdad27fc website: "tofu providers schema" nested_type docs
At some point after this documentation was originally written the schema
structure grew to include the possibility of structural attribute types,
represented using "nested_type" instead of "type" in the attribute
definition, but it seems that the documentation was not updated to mention
that.

This is just a minimal extra note about that focused mainly on just
acknowledging that this possibility exists at all, in case anyone is
relying on these docs to build something to parse this format. It would
probably be helpful to expand both this and the existing documentation to
specify the format more precisely, but my focus here is just on quickly
filling in this missing piece so that the documentation is complete, even
if not detailed and precise.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-11-19 07:20:49 -08:00
Martin Atkins
e389a7f2fa website: Warn about "tofu output -raw" in a terminal
By design the "-raw" option to "tofu output" writes the literal output
value directly to stdout without any quoting or escaping, and so it's
risky to use it with an output value that could be controlled by an
attacker when stdout is a terminal.

This risk is inherent in the purpose of this option and is part of the
reason why this is not the default behavior (OpenTofu returns a quoted
representation of an output string by default) so here we just make that
risk explicit in the documentation, in the hope that operators will use
this operation mindfully.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-11-10 09:49:35 -08:00
Martin Atkins
dc9bec611c website: Reorganize and tidy some lifecycle-related information
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>
2025-10-17 15:08:14 -07:00
Andrei Ciobanu
aa403e5f99 Add warning about -target arg usage with individual resource instance address (#3280)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-09-19 09:39:22 +03:00
Christian Mesh
c8b58e949b Address review comments
Co-authored-by: James Humphries <James@james-humphries.co.uk>
Co-authored-by: Ilia Gogotchuri <ilia.gogotchuri0@gmail.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-09-10 07:45:23 -04:00
Andrei Ciobanu
57057aef27 Add docs for all ephemeral constructs (#3209)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Diógenes Fernandes <diofeher@opentofu.org>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-09-10 07:45:23 -04:00
Diógenes Fernandes
11d416edf9 add for_each attribute to the mock_provider block (#3087)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-08-18 10:36:04 -03:00
Andrei Ciobanu
01493c357f Update apply documentation with the newly accepted -var/-var-file arguments (#3091)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-08-01 16:25:39 +03:00
Diógenes Fernandes
e718044193 docs: consolidate warnings are enabled by default (#3064)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-07-23 17:35:59 -03:00
Martin Atkins
6a27c82bb4 tofu show: -module=DIR mode, for showing just a single module
We previously added the -config mode for showing the entire assembled
configuration tree, including the content of any descendent modules, but
that mode requires first running "tofu init" to install all of the
provider and module dependencies of the configuration.

This new -module=DIR mode returns a subset of the same JSON representation
for only a single module that can be generated without first installing
any dependencies, making this mode more appropriate for situations like
generating documentation for a single module when importing it into the
OpenTofu Registry. The registry generation process does not want to endure
the overhead of installing other providers and modules when all it actually
needs is metadata about the top-level declarations in the module.

To minimize the risk to the already-working full-config JSON representation
while still reusing most of its code, the implementation details of package
jsonconfig are a little awkward here. Since this code changes relatively
infrequently and is implementing an external interface subject to
compatibility constraints, and since this new behavior is relatively
marginal and intended primarily for our own OpenTofu Registry purposes,
this is a pragmatic tradeoff that is hopefully compensated for well enough
by the code comments that aim to explain what's going on for the benefit
of future maintainers. If we _do_ find ourselves making substantial changes
to this code at a later date then we can consider a more significant
restructure of the code at that point; the weird stuff is intentionally
encapsulated inside package jsonconfig so it can change later without
changing any callers.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-07-10 13:18:26 -07:00
baa-ableton
3bdd0073a5 command: tofu show -config (#2820)
Signed-off-by: Babur Ayanlar <babur.ayanlar@ableton.com>
2025-06-02 10:15:46 -07:00
Andrei Ciobanu
2ef59e2299 Add note about the diff dependency on the fmt command (#2801)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-05-14 15:33:59 +03:00
Andrei Ciobanu
8305bfb2ef Rename the CLI arg for deprecation outputs/variables (#2774)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-05-09 14:01:32 +03:00
Andrei Ciobanu
22dc9b2137 Add new CLI arg to control what warnings should be shown for deprecated outputs/variables (#2705)
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-05-08 17:01:40 +03:00
Diógenes Fernandes
8440f6c095 docs: clarifying -filter and -test-directory behavior in tofu test (#2717)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-04-28 07:09:55 -04:00
Martin Atkins
f42dfbc497 tofu show: new explicit/extensible usage style
The "tofu show" command has historically been difficult to extend to meet
new use-cases, such as showing the current configuration without creating
a plan, because it was designed to take zero or one arguments and then try
to guess what the one specified argument was intended to mean.

This commit introduces a new style where the type of object to inspect is
specified using command line option syntax, using one of two
mutually-exclusive options:

    -state      Show the latest state snapshot.
    -plan=FILE  Show the plan from the given saved plan file.

We expect that a future commit will extend this with a new "-config" option
to inspect the configuration rooted in the current working directory, and
possibly with "-module=DIR" to shallowly inspect a single module without
necessarily having to fully initialize it with all of its dependencies
first. However, both of those use-cases (and any others) are not in scope
for this commit, which is focused only on refactoring to make those future
use-cases possible.

The old mode of specifying neither option and providing zero or one
positional arguments is still supported for backward compatibility.
Notably, the legacy style is the only way to access the legacy behavior of
inspecting a specific state snapshot file from the local filesystem, which
has not often been used since Terraform v0.9 as we've moved away
from manual management of state files to the structure of state backends.
Those who _do_ still need that old behavior can still access it in the
old way, but there will be no new-style equivalent of it unless we learn
of a compelling use case for it.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-04-24 15:04:11 -07:00
Diógenes Fernandes
4a64aa9192 Add remote sources to module on tofu test (#2651)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diógenes Fernandes <diofeher@opentofu.org>
Co-authored-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-04-24 14:02:22 -03:00
Martin Atkins
1260f2218c Documentation for the new -target-file and -exclude-file planning options (#2691)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-04-23 07:56:51 -04:00
Diógenes Fernandes
daa59d2ca8 Reflecting the current state of module source on tofu test docs (#2666)
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-04-16 09:41:21 -03:00
Ilia Gogotchuri
39d65540af Adds docs for tests - run references in test files (#2607)
Signed-off-by: Ilia Gogotchuri <ilia.gogotchuri0@gmail.com>
2025-03-18 18:38:35 +04:00
Diógenes Fernandes
662b101112 feat: remove progress messages from commands using -concise argument (#2549)
Signed-off-by: Diógenes Fernandes <diofeher@gmail.com>
Signed-off-by: Diogenes Fernandes <diofeher@gmail.com>
2025-03-04 11:30:31 -03:00
Oleksandr Levchenkov
d7af2c4d39 update tofu console docs for non-interactive use-case (#2369)
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: Oleksandr Levchenkov <ollevche@gmail.com>
Co-authored-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com>
2025-01-14 19:03:30 +02:00
Christian Mesh
f6a1d8e2dd Support References in Variable Validation (#2216)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-12-04 14:24:44 -05:00
Oleksandr Levchenkov
6c8bfa2794 implement override resources for mock providers (#2168)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-12-03 11:24:26 -05:00
Oleksandr Levchenkov
5264ccee99 fix documentation typo in mock provider link (#2146)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-11-06 17:30:40 +02:00
Arel Rabinowitz
3d4bf29c56 Add exclude flag support (#1900)
Signed-off-by: RLRabinowitz <rlrabinowitz2@gmail.com>
2024-11-05 10:16:00 -05:00
Nathan Baulch
9b7bec31b4 Another batch of minor typos (#1953)
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-09 07:51:39 -04:00
Oleksandr Levchenkov
c3ddd51d8c update documentation images (#1864)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-07-29 11:47:07 -04:00
Christian Mesh
3b3822d770 Improve documentation around static evaluation (#1843)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: ollevche <ollevche@gmail.com>
Co-authored-by: ollevche <ollevche@gmail.com>
2024-07-23 09:31:50 -04:00
Ronny Orot
faf9f6aedc Add documentation about the new .tofu extension (#1841)
Signed-off-by: Ronny Orot <ronny.orot@gmail.com>
2024-07-22 18:35:59 +03:00
Oleksandr Levchenkov
9d9a7aab06 add mock providers for testing framework (#1772)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-07-09 14:41:52 +03:00
Oleksandr Levchenkov
64fb36dc54 add override implementation for testing framework (#1499)
Signed-off-by: ollevche <ollevche@gmail.com>
Signed-off-by: Oleksandr Levchenkov <ollevche@gmail.com>
Co-authored-by: Janos <86970079+janosdebugs@users.noreply.github.com>
Co-authored-by: Ronny Orot <ronny.orot@gmail.com>
2024-06-06 13:20:41 +03:00
Alex Ott
7e1a02cbb8 Make persist interval for remote state backend configurable (#1591)
Signed-off-by: Alex Ott <alexott@gmail.com>
Co-authored-by: Siddhartha Sonker <158144589+siddharthasonker95@users.noreply.github.com>
2024-05-28 13:47:16 -04:00
Oleksandr Levchenkov
8361438c52 remove copyright headers from website examples and lock files (#1687)
Signed-off-by: ollevche <ollevche@gmail.com>
2024-05-28 13:40:19 -04:00
SaiCharanReddyAdla
a4fb0f3fa3 Fix #1375 - missing cli command options (#1448)
Signed-off-by: SaiCharanReddy Adla <saicharanreddy.adla@fmr.com>
Signed-off-by: SaiCharanReddyAdla <163337878+SaiCharanReddyAdla@users.noreply.github.com>
2024-04-25 14:29:47 +02:00
Janos
a15a6c9657 Versioned docs: replacing docs links with relative variants (#1537)
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com>
Signed-off-by: Damian Stasik <920747+damianstasik@users.noreply.github.com>
Signed-off-by: Roman Grinovski <roman.grinovski@gmail.com>
Co-authored-by: Damian Stasik <920747+damianstasik@users.noreply.github.com>
Co-authored-by: Roman Grinovski <roman.grinovski@gmail.com>
2024-04-24 13:24:30 +02:00
Syasusu
0b90cc3383 doc: add -json flag doc for init and get command (#1460)
Signed-off-by: Syasusu <syasusu@163.com>
2024-04-08 13:17:40 +02:00
Sanskruti Shahu
08f9a740ac Added support to use .tfvars files from tests folder (#1386)
Signed-off-by: sanskruti-shahu <sanskruti.shahu@harness.io>
2024-03-29 08:44:27 -04:00
Shashwat Pandey
e539576a84 added documentation of -concise flag for plan (#1356)
Signed-off-by: Shashwat Pandey <72958686+SypherSP@users.noreply.github.com>
2024-03-11 12:03:54 +01:00
namgyalangmo
cb2e9119aa Update copyright notice (#1232)
Signed-off-by: namgyalangmo <75657887+namgyalangmo@users.noreply.github.com>
2024-02-08 09:48:59 +00:00
Damian Stasik
5071fdc233 Escape wildcard signs in docs/cli/commands/test/index.mdx (#1110) 2024-01-12 11:46:14 +01:00
Christian Mesh
b186fd3912 Docs update, remove additional terraform references (#1046)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Janos <86970079+janosdebugs@users.noreply.github.com>
2023-12-21 08:58:23 -05:00
Ronny Orot
99e51a166d Fix renaming mistakes in docs (#1012)
Signed-off-by: Ronny Orot <ronny.orot@gmail.com>
2023-12-14 13:16:21 +02:00
Christian Mesh
abd324ea7c Revert "Fixes #898: Replace hashicorp and terraform references" (#995) 2023-12-11 15:10:03 -05:00
Janos
15bef1428a Fixes #898: Replace hashicorp and terraform references (#973)
Signed-off-by: Janos Bonic <86970079+janosdebugs@users.noreply.github.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
2023-12-08 08:03:09 -05:00
Janos
478a6ecf81 Fixes #292: Fixing broken website build (#952)
Signed-off-by: Janos Bonic <86970079+janosdebugs@users.noreply.github.com>
2023-12-01 11:24:27 +00:00
Janos
e2613d7bf0 Fixes #292: Testing feature documentation (#939)
Signed-off-by: Janos Bonic <86970079+janosdebugs@users.noreply.github.com>
Co-authored-by: James Humphries <James@james-humphries.co.uk>
2023-12-01 08:34:59 +00:00
Dmitry Kisler
d077a33939 Add tofu test command definition (#886)
Signed-off-by: Dmitry Kisler <admin@dkisler.com>
2023-11-17 18:40:22 +01:00
RLRabinowitz
1b9148a3de Remove Terraform mentions in docs in the codebase (#713) 2023-10-12 12:11:01 +01:00