Commit Graph

406 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
Andrei Ciobanu
4f57c826f0 Add download_retry_count for direct and network_mirror in CLI configuration (#3368)
Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org>
2025-10-18 11:42:25 +03: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
Martin Atkins
2d2b08517e cliconfig: Registry protocol retry count and timeout settings
These were previously settable only via environment variables. These are
now handled as part of CLI Configuration and so also settable in a new
"registry_protocols" block in a CLI configuration file, with the
environment variables now treated as if they are an additional virtual
configuration file containing the corresponding settings.

This handles our settings in our modern style where package cliconfig is
responsible for deciding the configuration and then package main reacts
to that configuration without being aware of how it is decided.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-09-10 11:45:38 -07: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
Martin Atkins
528b778363 website: ORAS v1.3 variant of provider OCI mirror construction
ORAS v1.3.0 introduces some new features that allow directly building an
index manifest in the form that OpenTofu expects, so it's no longer
necessary to edit that index manifest manually.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-09-09 13:22:48 -07: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
Martin Atkins
23d2eafe67 website: OCI provider mirror build doesn't need --artifact-platform (#2964)
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-06-30 07:32:04 -04:00
Christian Mesh
59659c8009 Add TOFU_CPU_PROFILE for enabling go pprof (#2904)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-06-16 09:02:54 -04: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
Martin Atkins
85a90f3d78 website: OCI provider mirror shouldn't talk about prereleases anymore
This text was from earlier on in the development period when we hadn't yet
settled on a strategy, but now we are intending to work with the ORAS team
so that ORAS can construct index manifests in the form that OpenTofu
expects, so we'll talk about that instead of making a comment about
prereleases that will become confusing once OpenTofu v1.10.0 final is
released.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-05-28 08:55:29 -07:00
Patrick Decat
9ac06d3c8b docs: relocate sentence about .terraformignore to proper section (#2812)
Signed-off-by: Patrick Decat <pdecat@gmail.com>
2025-05-16 13:54:30 +03: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
Martin Atkins
91da758a9a website: Remove the "very early draft" note from OCI Registry content
For the v1.10.0-alpha1 release, where we weren't even feature-complete yet,
we included a callout box warning that features were incomplete and details
subject to change.

We're not expecting to issue another alpha before we reach the beta phase
during which we'll be aiming to change the design of these features as
little as possible, so it's time to remove that callout box.

In its place we now have a short statement about which versions of the
OCI Distribution protocol we support. Because some registries allow and
just ignore unrecognized properties in submitted manifests it is possible
that these features will work with older implementations, but such support
is not guaranteed by earlier versions of the specification. In practice,
OCI Distribution v1.1.0 is already quite well-deployed.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-05-06 07:56:54 -07:00
Martin Atkins
b78ab83f76 website: Note about Docker-style credential helper configuration
From feedback in alpha testing of the new OCI Distribution features we
learned that on some platforms Docker CLI automatically searches for
platform-specific credential helpers and uses them automatically when
found, but OpenTofu intentionally does not copy that behavior.

We'll now be explicit about that intentional difference in a callout box
in the documentation. This is unfortunately the kind of situation where
an affected person is unlikely to read the documentation to find out what
_isn't_ supported, and so this content is primarily intended to appear
in search results and other similar indirect querying, rather than by the
reader encountering it organically while reading the documentation. It's
therefore placed adjacent to the configuration option that someone might
use to solve the problem once they've learned about it.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-05-06 07:56:54 -07: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
Christian Mesh
d0ee5a36a5 Provider plugin cache locking (#1878)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2025-04-25 09:39:17 -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
Martin Atkins
1421849989 website: Documentation for module packages in OCI repositories
This is a first draft of documentation describing our new capability to
treat artifacts in OCI Distribution repositories as a new kind of remote
module package.

This documentation includes both some caller-focused documentation that
extends our existing "Module Sources" page, and some documentation intended
more for the author of a module package describing how they could publish
their package as an OCI artifact that OpenTofu will accept.

As usual, we'll continue to refine this documentation based on feedback
during the prerelease period and beyond.

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-04-21 10:11:44 -07: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
Martin Atkins
daabee5873 website: OCI provider mirror setup additional index manifest step
We are currently documenting how to manually edit the index manifest while
we wait for the ORAS CLI support for this to be finalized, but the initial
draft of these instructions missed the step of annotating each manifest
with the platform it's intended for.

(We intend to replace all of this manual setup with a single ORAS CLI
command once the associated functionality is finalized there. At the time
of writing this message, the ORAS project is preparing that functionality
for their forthcoming v1.3.0 release.)

Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-27 08:53:26 -07:00
Martin Atkins
1b673291bc website: Very early docs for the new OCI Registry functionality
Signed-off-by: Martin Atkins <mart@degeneration.co.uk>
2025-03-26 09:49:23 -07: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
Nathan Baulch
ea558d9d4b Fix typos (#1905)
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
2024-08-29 13:20:33 -04:00
Ronny Orot
23d69e2351 Cloud Backend - Fix logic that forces TF_WORKSPACE to be equal to a tag name (#1930)
Signed-off-by: Ronny Orot <ronny.orot@gmail.com>
2024-08-22 10:55:50 +03:00
Jordan Pitlor
0e6d14b301 Update environment-variables.mdx (#1885)
Signed-off-by: Jordan Pitlor <jpitlor@gmail.com>
Signed-off-by: Jordan Pitlor <jordan@pitlor.dev>
2024-08-07 11:25:44 +03: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
Andrew Hayes
520165c089 Adds TACOS page to docs and links to it from all mentionds of TACOS (#1836)
Signed-off-by: Andrew Hayes <andrew.hayes@harness.io>
2024-07-23 09:55:58 +01: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