mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
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>
This commit is contained in:
@@ -7,7 +7,7 @@ description: >-
|
||||
# State Storage and Locking
|
||||
|
||||
Backends are responsible for storing state and providing an API for
|
||||
[state locking](/docs/language/state/locking). State locking is optional.
|
||||
[state locking](../../language/state/locking.mdx). State locking is optional.
|
||||
|
||||
Despite the state being stored remotely, all OpenTofu commands such
|
||||
as `tofu console`, the `tofu state` operations, `tofu taint`,
|
||||
@@ -62,10 +62,10 @@ prior to forcing the overwrite.
|
||||
|
||||
## State Locking
|
||||
|
||||
Backends are responsible for supporting [state locking](/docs/language/state/locking)
|
||||
Backends are responsible for supporting [state locking](../../language/state/locking.mdx)
|
||||
if possible.
|
||||
|
||||
Not all backends support locking. The [documentation for each backend](/docs/language/settings/backends/configuration#available-backends) includes details about whether it supports locking or not.
|
||||
Not all backends support locking. The [documentation for each backend](../../language/settings/backends/configuration.mdx#available-backends) includes details about whether it supports locking or not.
|
||||
|
||||
For more information on state locking, view the
|
||||
[page dedicated to state locking](/docs/language/state/locking).
|
||||
[page dedicated to state locking](../../language/state/locking.mdx).
|
||||
|
||||
@@ -78,7 +78,7 @@ Once your data is encrypted, do not rename key providers and methods in your con
|
||||
|
||||
:::tip
|
||||
|
||||
You can use the [JSON configuration syntax](/docs/language/syntax/json/) instead of HCL for encryption configuration.
|
||||
You can use the [JSON configuration syntax](../../language/syntax/json.mdx) instead of HCL for encryption configuration.
|
||||
|
||||
:::
|
||||
|
||||
@@ -154,7 +154,7 @@ The PBKDF2 key provider allows you to use a long passphrase as to generate a key
|
||||
|
||||
### AWS KMS
|
||||
|
||||
This key provider uses the [Amazon Web Servers Key Management Service](https://aws.amazon.com/kms/) to generate keys. The authentication options are identical to the [S3 backend](/docs/language/settings/backends/s3/) excluding any deprecated options. In addition, please provide the following options:
|
||||
This key provider uses the [Amazon Web Servers Key Management Service](https://aws.amazon.com/kms/) to generate keys. The authentication options are identical to the [S3 backend](../../language/settings/backends/s3.mdx) excluding any deprecated options. In addition, please provide the following options:
|
||||
|
||||
| Option | Description | Min. | Default |
|
||||
|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|------|---------|
|
||||
@@ -167,7 +167,7 @@ The following example illustrates a minimal configuration:
|
||||
|
||||
### GCP KMS
|
||||
|
||||
This key provider uses the [Google Cloud Key Management Service](https://cloud.google.com/kms/docs) to generate keys. The authentication options are identical to the [GCS backend](/docs/language/settings/backends/gcs/) excluding any deprecated options. In addition, please provide the following options:
|
||||
This key provider uses the [Google Cloud Key Management Service](https://cloud.google.com/kms/docs) to generate keys. The authentication options are identical to the [GCS backend](../../language/settings/backends/gcs.mdx) excluding any deprecated options. In addition, please provide the following options:
|
||||
|
||||
| Option | Description | Min. | Default |
|
||||
|---------------------------------------|------------------------------------------------------------------------------------------------------------------|------|---------|
|
||||
|
||||
@@ -9,4 +9,4 @@ description: >-
|
||||
OpenTofu is able to import existing infrastructure. This allows you to take
|
||||
resources you have created by some other means and bring them under OpenTofu management.
|
||||
|
||||
To learn more, see [Import](/docs/language/import).
|
||||
To learn more, see [Import](../../language/import/index.mdx).
|
||||
|
||||
@@ -17,7 +17,7 @@ to version, encrypt, and securely share it with your team.
|
||||
|
||||
OpenTofu uses state to determine which changes to make to your
|
||||
infrastructure. Prior to any operation, OpenTofu does a
|
||||
[refresh](/docs/cli/commands/refresh) to update the state with the
|
||||
[refresh](../../cli/commands/refresh.mdx) to update the state with the
|
||||
real infrastructure.
|
||||
|
||||
The primary purpose of OpenTofu state is to store bindings between objects in
|
||||
@@ -28,13 +28,13 @@ resource instance, and then potentially update or delete that object in
|
||||
response to future configuration changes.
|
||||
|
||||
For more information on why OpenTofu requires state and why OpenTofu cannot
|
||||
function without state, please see the page [state purpose](/docs/language/state/purpose).
|
||||
function without state, please see the page [state purpose](../../language/state/purpose.mdx).
|
||||
|
||||
## Inspection and Modification
|
||||
|
||||
While the format of the state files are just JSON, direct file editing
|
||||
of the state is discouraged. OpenTofu provides the
|
||||
[tofu state](/docs/cli/commands/state) command to perform
|
||||
[tofu state](../../cli/commands/state/index.mdx) command to perform
|
||||
basic modifications of the state using the CLI.
|
||||
|
||||
The CLI usage and output of the state commands is structured to be
|
||||
@@ -67,10 +67,10 @@ in new versions.
|
||||
Alternatively, there are several integration points which produce JSON output
|
||||
that is specifically intended for consumption by external software:
|
||||
|
||||
* [The `tofu output` command](/docs/cli/commands/output)
|
||||
* [The `tofu output` command](../../cli/commands/output.mdx)
|
||||
has a `-json` option, for obtaining either the full set of root module output
|
||||
values or a specific named output value from the latest state snapshot.
|
||||
* [The `tofu show` command](/docs/cli/commands/show) has a `-json`
|
||||
* [The `tofu show` command](../../cli/commands/show.mdx) has a `-json`
|
||||
option for inspecting the latest state snapshot in full, and also for
|
||||
inspecting saved plan files which include a copy of the prior state at the
|
||||
time the plan was made.
|
||||
|
||||
@@ -6,7 +6,7 @@ description: >-
|
||||
|
||||
# State Locking
|
||||
|
||||
If supported by your [backend](/docs/language/settings/backends/configuration), OpenTofu will lock your
|
||||
If supported by your [backend](../../language/settings/backends/configuration.mdx), OpenTofu will lock your
|
||||
state for all operations that could write state. This prevents
|
||||
others from acquiring the lock and potentially corrupting your state.
|
||||
|
||||
@@ -20,12 +20,12 @@ a status message. If OpenTofu doesn't output a message, state locking is
|
||||
still occurring if your backend supports it.
|
||||
|
||||
Not all backends support locking. The
|
||||
[documentation for each backend](/docs/language/settings/backends/configuration)
|
||||
[documentation for each backend](../../language/settings/backends/configuration.mdx)
|
||||
includes details on whether it supports locking or not.
|
||||
|
||||
## Force Unlock
|
||||
|
||||
OpenTofu has a [force-unlock command](/docs/cli/commands/force-unlock)
|
||||
OpenTofu has a [force-unlock command](../../cli/commands/force-unlock.mdx)
|
||||
to manually unlock the state if unlocking failed.
|
||||
|
||||
**Be very careful with this command.** If you unlock the state when someone
|
||||
|
||||
@@ -101,7 +101,7 @@ started, but when using OpenTofu in a team it is important for everyone
|
||||
to be working with the same state so that operations will be applied to the
|
||||
same remote objects.
|
||||
|
||||
[Remote state](/docs/language/state/remote) is the recommended solution
|
||||
[Remote state](../../language/state/remote.mdx) is the recommended solution
|
||||
to this problem. With a fully-featured state backend, OpenTofu can use
|
||||
remote locking as a measure to avoid two or more different users accidentally
|
||||
running OpenTofu at the same time, and thus ensure that each OpenTofu run
|
||||
|
||||
@@ -9,7 +9,7 @@ description: >-
|
||||
The `terraform_remote_state` data source uses the latest state snapshot from a specified state backend to retrieve the root module output values
|
||||
from some other OpenTofu configuration.
|
||||
|
||||
You can use the `terraform_remote_state` data source without requiring or configuring a provider. It is always available through a built-in provider with the [source address](/docs/language/providers/requirements#source-addresses) `terraform.io/builtin/terraform`. That provider does not include any other resources or data sources.
|
||||
You can use the `terraform_remote_state` data source without requiring or configuring a provider. It is always available through a built-in provider with the [source address](../../language/providers/requirements.mdx#source-addresses) `terraform.io/builtin/terraform`. That provider does not include any other resources or data sources.
|
||||
|
||||
## Alternative Ways to Share Data Between Configurations
|
||||
|
||||
@@ -73,14 +73,14 @@ use of. For example:
|
||||
Some of the data stores listed above are specifically designed for storing
|
||||
small configuration values, while others are generic blob storage systems. For
|
||||
those generic systems, you can use
|
||||
[the `jsonencode` function](/docs/language/functions/jsonencode)
|
||||
[the `jsonencode` function](../../language/functions/jsonencode.mdx)
|
||||
and
|
||||
[the `jsondecode` function](/docs/language/functions/jsondecode) respectively
|
||||
[the `jsondecode` function](../../language/functions/jsondecode.mdx) respectively
|
||||
to store and retrieve structured data.
|
||||
|
||||
You can encapsulate the implementation details of retrieving your published
|
||||
configuration data by writing a
|
||||
[data-only module](/docs/language/modules/develop/composition#data-only-modules)
|
||||
[data-only module](../../language/modules/develop/composition.mdx#data-only-modules)
|
||||
containing the necessary data source configuration and any necessary
|
||||
post-processing such as JSON decoding. You can then change that module later
|
||||
if you switch to a different strategy for sharing data between multiple
|
||||
@@ -136,7 +136,7 @@ The following arguments are supported:
|
||||
|
||||
The `config` object can use any arguments that would be valid in the
|
||||
equivalent `terraform { backend "<TYPE>" { ... } }` block. See
|
||||
[the documentation of your chosen backend](/docs/language/settings/backends/configuration)
|
||||
[the documentation of your chosen backend](../../language/settings/backends/configuration.mdx)
|
||||
for details.
|
||||
|
||||
:::note
|
||||
@@ -152,7 +152,7 @@ The following arguments are supported:
|
||||
In addition to the above, the following attributes are exported:
|
||||
|
||||
* `outputs` - An object containing every root-level
|
||||
[output](/docs/language/values/outputs) in the remote state.
|
||||
[output](../../language/values/outputs.mdx) in the remote state.
|
||||
|
||||
## Root Outputs Only
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@ which can then be shared between all members of a team. OpenTofu supports
|
||||
storing state in TACOS (TF Automation and Collaboration Software),
|
||||
[HashiCorp Consul](https://www.consul.io/), Amazon S3, Azure Blob Storage, Google Cloud Storage, Alibaba Cloud OSS, and more.
|
||||
|
||||
Remote state is implemented by a [backend](/docs/language/settings/backends/configuration) or by
|
||||
Remote state is implemented by a [backend](../../language/settings/backends/configuration.mdx) or by
|
||||
TACOS (TF Automation and Collaboration Software), both of which you can configure in your configuration's root module.
|
||||
|
||||
## Delegation and Teamwork
|
||||
|
||||
Remote state allows you to share
|
||||
[output values](/docs/language/values/outputs) with other configurations.
|
||||
[output values](../../language/values/outputs.mdx) with other configurations.
|
||||
This allows your infrastructure to be decomposed into smaller components.
|
||||
|
||||
Put another way, remote state also allows teams to share infrastructure
|
||||
@@ -37,7 +37,7 @@ you can expose things such as VPC IDs, subnets, NAT instance IDs, etc. through
|
||||
remote state and have other OpenTofu states consume that.
|
||||
|
||||
For example usage, see
|
||||
[the `terraform_remote_state` data source](/docs/language/state/remote-state-data).
|
||||
[the `terraform_remote_state` data source](../../language/state/remote-state-data.mdx).
|
||||
|
||||
While remote state can be a convenient, built-in mechanism for sharing data
|
||||
between configurations, you may prefer to use more general stores to
|
||||
@@ -51,7 +51,7 @@ another that consumes those values using
|
||||
## Locking and Teamwork
|
||||
|
||||
For fully-featured remote backends, OpenTofu can also use
|
||||
[state locking](/docs/language/state/locking) to prevent concurrent runs of
|
||||
[state locking](../../language/state/locking.mdx) to prevent concurrent runs of
|
||||
OpenTofu against the same state.
|
||||
|
||||
TACOS (TF Automation and Collaboration Software) is a commercial offering
|
||||
|
||||
@@ -11,7 +11,7 @@ passwords.
|
||||
|
||||
When using local state, state is stored in plain-text JSON files.
|
||||
|
||||
When using [remote state](/docs/language/state/remote), state is only ever held in
|
||||
When using [remote state](../../language/state/remote.mdx), state is only ever held in
|
||||
memory when used by OpenTofu. It may be encrypted at rest, but this depends on
|
||||
the specific remote state backend.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ description: >-
|
||||
|
||||
# Workspaces
|
||||
|
||||
Each OpenTofu configuration has an associated [backend](/docs/language/settings/backends/configuration) that defines how OpenTofu executes operations and where OpenTofu stores persistent data, like [state](/docs/language/state/purpose).
|
||||
Each OpenTofu configuration has an associated [backend](../../language/settings/backends/configuration.mdx) that defines how OpenTofu executes operations and where OpenTofu stores persistent data, like [state](../../language/state/purpose.mdx).
|
||||
|
||||
The persistent data stored in the backend belongs to a workspace. The backend initially has only one workspace containing one OpenTofu state associated with that configuration. Some backends support multiple named workspaces, allowing multiple states to be associated with a single configuration. The configuration still has only one backend, but you can deploy multiple distinct instances of that configuration without configuring a new backend or changing authentication
|
||||
credentials.
|
||||
@@ -15,29 +15,29 @@ credentials.
|
||||
|
||||
You can use multiple workspaces with the following backends:
|
||||
|
||||
- [AzureRM](/docs/language/settings/backends/azurerm)
|
||||
- [Consul](/docs/language/settings/backends/consul)
|
||||
- [COS](/docs/language/settings/backends/cos)
|
||||
- [GCS](/docs/language/settings/backends/gcs)
|
||||
- [Kubernetes](/docs/language/settings/backends/kubernetes)
|
||||
- [Local](/docs/language/settings/backends/local)
|
||||
- [OSS](/docs/language/settings/backends/oss)
|
||||
- [Postgres](/docs/language/settings/backends/pg)
|
||||
- [Remote](/docs/language/settings/backends/remote)
|
||||
- [S3](/docs/language/settings/backends/s3)
|
||||
- [AzureRM](../../language/settings/backends/azurerm.mdx)
|
||||
- [Consul](../../language/settings/backends/consul.mdx)
|
||||
- [COS](../../language/settings/backends/cos.mdx)
|
||||
- [GCS](../../language/settings/backends/gcs.mdx)
|
||||
- [Kubernetes](../../language/settings/backends/kubernetes.mdx)
|
||||
- [Local](../../language/settings/backends/local.mdx)
|
||||
- [OSS](../../language/settings/backends/oss.mdx)
|
||||
- [Postgres](../../language/settings/backends/pg.mdx)
|
||||
- [Remote](../../language/settings/backends/remote.mdx)
|
||||
- [S3](../../language/settings/backends/s3.mdx)
|
||||
|
||||
|
||||
## Using Workspaces
|
||||
|
||||
:::warning Important
|
||||
Workspaces are not appropriate for system decomposition or deployments requiring separate credentials and access controls. Refer to [Use Cases](/docs/cli/workspaces#use-cases) in the OpenTofu CLI documentation for details and recommended alternatives.
|
||||
Workspaces are not appropriate for system decomposition or deployments requiring separate credentials and access controls. Refer to [Use Cases](../../cli/workspaces/index.mdx#use-cases) in the OpenTofu CLI documentation for details and recommended alternatives.
|
||||
:::
|
||||
|
||||
OpenTofu starts with a single, default workspace named `default` that you cannot delete. If you have not created a new workspace, you are using the default workspace in your OpenTofu working directory.
|
||||
|
||||
When you run `tofu plan` in a new workspace, OpenTofu does not access existing resources in other workspaces. These resources still physically exist, but you must switch workspaces to manage them.
|
||||
|
||||
Refer to the [OpenTofu CLI workspaces](/docs/cli/workspaces) documentation for full details about how to create and use workspaces.
|
||||
Refer to the [OpenTofu CLI workspaces](../../cli/workspaces/index.mdx) documentation for full details about how to create and use workspaces.
|
||||
|
||||
|
||||
## Current Workspace Interpolation
|
||||
|
||||
Reference in New Issue
Block a user