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:
@@ -118,7 +118,7 @@ terraform {
|
||||
```
|
||||
|
||||
:::note
|
||||
When using a Service Principal or an Access Key - we recommend using a [Partial Configuration](/docs/language/settings/backends/configuration#partial-configuration) for the credentials.
|
||||
When using a Service Principal or an Access Key - we recommend using a [Partial Configuration](../../../language/settings/backends/configuration.mdx#partial-configuration) for the credentials.
|
||||
:::
|
||||
|
||||
## Data Source Configuration
|
||||
@@ -237,7 +237,7 @@ data "terraform_remote_state" "foo" {
|
||||
## Configuration Variables
|
||||
|
||||
:::danger Warning
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](/docs/language/settings/backends/configuration#credentials-and-sensitive-data) for details.
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](../../../language/settings/backends/configuration.mdx#credentials-and-sensitive-data) for details.
|
||||
:::
|
||||
|
||||
The following configuration options are supported:
|
||||
|
||||
@@ -6,7 +6,7 @@ description: >-
|
||||
|
||||
# Backend Configuration
|
||||
|
||||
A backend defines where OpenTofu stores its [state](/docs/language/state) data files.
|
||||
A backend defines where OpenTofu stores its [state](../../../language/state/index.mdx) data files.
|
||||
|
||||
OpenTofu uses persisted state data to keep track of the resources it manages. Most non-trivial OpenTofu configurations either intergrate with TACOS (TF Automation and Collaboration Software) or use a backend to store state remotely. This lets multiple people access the state data and work together on that collection of infrastructure resources.
|
||||
|
||||
@@ -14,14 +14,14 @@ This page describes how to configure a backend by adding the [`backend` block](#
|
||||
|
||||
## Available Backends
|
||||
|
||||
By default, OpenTofu uses a backend called [`local`](/docs/language/settings/backends/local), which stores state as a local file on disk. You can also configure one of the built-in backends included in this documentation.
|
||||
By default, OpenTofu uses a backend called [`local`](../../../language/settings/backends/local.mdx), which stores state as a local file on disk. You can also configure one of the built-in backends included in this documentation.
|
||||
|
||||
Some of these backends act like plain remote disks for state files, while others support locking the state while operations are being performed. This helps prevent conflicts and inconsistencies. The built-in backends listed are the only backends. You cannot load additional backends as plugins.
|
||||
|
||||
## Using a Backend Block
|
||||
|
||||
You do not need to configure a backend when using TACOS (TF Automation and Collaboration Software) because
|
||||
it automatically manages state in the workspaces associated with your configuration. If your configuration includes a [`cloud` block](/docs/language/settings/tf-cloud), it cannot include a `backend` block.
|
||||
it automatically manages state in the workspaces associated with your configuration. If your configuration includes a [`cloud` block](../../../language/settings/tf-cloud.mdx), it cannot include a `backend` block.
|
||||
|
||||
To configure a backend, add a nested `backend` block within the top-level
|
||||
`terraform` block. The following example configures the `remote` backend.
|
||||
@@ -79,7 +79,7 @@ or state operations.
|
||||
|
||||
After you initialize, OpenTofu creates a `.terraform/` directory locally. This directory contains the most recent backend configuration, including any authentication parameters you provided to the OpenTofu CLI. Do not check this directory into Git, as it may contain sensitive credentials for your remote backend.
|
||||
|
||||
The local backend configuration is different and entirely separate from the `terraform.tfstate` file that contains [state data](/docs/language/state) about your real-world infrastruture. OpenTofu stores the `terraform.tfstate` file in your remote backend.
|
||||
The local backend configuration is different and entirely separate from the `terraform.tfstate` file that contains [state data](../../../language/state/index.mdx) about your real-world infrastruture. OpenTofu stores the `terraform.tfstate` file in your remote backend.
|
||||
|
||||
When you change backends, OpenTofu gives you the option to migrate
|
||||
your state to the new backend. This lets you adopt backends without losing
|
||||
@@ -98,7 +98,7 @@ automatically by an automation script running OpenTofu. When some or all of
|
||||
the arguments are omitted, we call this a _partial configuration_.
|
||||
|
||||
With a partial configuration, the remaining configuration arguments must be
|
||||
provided as part of [the initialization process](/docs/cli/init).
|
||||
provided as part of [the initialization process](../../../cli/init/index.mdx).
|
||||
|
||||
There are several ways to supply the remaining arguments:
|
||||
|
||||
@@ -181,12 +181,12 @@ both the configuration itself as well as the type of backend (for example
|
||||
from "consul" to "s3").
|
||||
|
||||
OpenTofu will automatically detect any changes in your configuration
|
||||
and request a [reinitialization](/docs/cli/init). As part of
|
||||
and request a [reinitialization](../../../cli/init/index.mdx). As part of
|
||||
the reinitialization process, OpenTofu will ask if you'd like to migrate
|
||||
your existing state to the new configuration. This allows you to easily
|
||||
switch from one backend to another.
|
||||
|
||||
If you're using multiple [workspaces](/docs/language/state/workspaces),
|
||||
If you're using multiple [workspaces](../../../language/state/workspaces.mdx),
|
||||
OpenTofu can copy all workspaces to the destination. If OpenTofu detects
|
||||
you have multiple workspaces, it will ask if this is what you want to do.
|
||||
|
||||
@@ -197,7 +197,7 @@ want to migrate your state. You can respond "no" in this scenario.
|
||||
|
||||
If you no longer want to use any backend, you can simply remove the
|
||||
configuration from the file. OpenTofu will detect this like any other
|
||||
change and prompt you to [reinitialize](/docs/cli/init).
|
||||
change and prompt you to [reinitialize](../../../cli/init/index.mdx).
|
||||
|
||||
As part of the reinitialization, OpenTofu will ask if you'd like to migrate
|
||||
your state back down to normal local state. Once this is complete then
|
||||
|
||||
@@ -7,7 +7,7 @@ description: OpenTofu can store state in Consul.
|
||||
|
||||
Stores the state in the [Consul](https://www.consul.io/) KV store at a given path.
|
||||
|
||||
This backend supports [state locking](/docs/language/state/locking).
|
||||
This backend supports [state locking](../../../language/state/locking.mdx).
|
||||
|
||||
## Example Configuration
|
||||
|
||||
@@ -22,7 +22,7 @@ terraform {
|
||||
```
|
||||
|
||||
Note that for the access credentials we recommend using a
|
||||
[partial configuration](/docs/language/settings/backends/configuration#partial-configuration).
|
||||
[partial configuration](../../../language/settings/backends/configuration.mdx#partial-configuration).
|
||||
|
||||
## Data Source Configuration
|
||||
|
||||
@@ -38,7 +38,7 @@ data "terraform_remote_state" "foo" {
|
||||
## Configuration Variables
|
||||
|
||||
:::danger Warning
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](/docs/language/settings/backends/configuration#credentials-and-sensitive-data) for details.
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](../../../language/settings/backends/configuration.mdx#credentials-and-sensitive-data) for details.
|
||||
:::
|
||||
|
||||
The following configuration options / environment variables are supported:
|
||||
|
||||
@@ -9,7 +9,7 @@ description: >-
|
||||
|
||||
Stores the state as an object in a configurable prefix in a given bucket on [Tencent Cloud Object Storage](https://intl.cloud.tencent.com/product/cos) (COS).
|
||||
|
||||
This backend supports [state locking](/docs/language/state/locking). Storing your state in a COS bucket requires the following permissions:
|
||||
This backend supports [state locking](../../../language/state/locking.mdx). Storing your state in a COS bucket requires the following permissions:
|
||||
|
||||
- `CreateTag`, `DeleteTag`, and `DescribeTags` on the tag key `tencentcloud-terraform-lock`
|
||||
- `Put`, `Get`, and `Delete` files for the specified bucket's prefix
|
||||
@@ -36,7 +36,7 @@ OpenTofu state will be written into the file `tofu/state/terraform.tfstate`.
|
||||
|
||||
## Data Source Configuration
|
||||
|
||||
To make use of the COS remote state in another configuration, use the [`terraform_remote_state` data source](/docs/language/state/remote-state-data).
|
||||
To make use of the COS remote state in another configuration, use the [`terraform_remote_state` data source](../../../language/state/remote-state-data.mdx).
|
||||
|
||||
```hcl
|
||||
data "terraform_remote_state" "foo" {
|
||||
@@ -53,7 +53,7 @@ data "terraform_remote_state" "foo" {
|
||||
## Configuration Variables
|
||||
|
||||
:::danger Warning
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](/docs/language/settings/backends/configuration#credentials-and-sensitive-data) for details.
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](../../../language/settings/backends/configuration.mdx#credentials-and-sensitive-data) for details.
|
||||
:::
|
||||
|
||||
The following configuration options or environment variables are supported:
|
||||
|
||||
@@ -10,7 +10,7 @@ description: >-
|
||||
Stores the state as an object in a configurable prefix in a pre-existing bucket on [Google Cloud Storage](https://cloud.google.com/storage/) (GCS).
|
||||
The bucket must exist prior to configuring the backend.
|
||||
|
||||
This backend supports [state locking](/docs/language/state/locking).
|
||||
This backend supports [state locking](../../../language/state/locking.mdx).
|
||||
|
||||
:::warning
|
||||
It is highly recommended that you enable
|
||||
@@ -94,7 +94,7 @@ To get started, follow this guide: [Use customer-managed encryption keys](https:
|
||||
|
||||
If you want to remove customer-managed keys from your backend configuration or change to a different customer-managed key, OpenTofu _can_ manage a state migration without manual intervention. This ability is because GCP stores customer-managed encryption keys and are accessible during the state migration process. However, these changes do not fully come into effect until the first write operation occurs on the state file after state migration occurs. In the first write operation after state migration, the file decrypts with the old key and then writes with the new encryption method. This method is equivalent to the [rewrite](https://cloud.google.com/storage/docs/gsutil/commands/rewrite) operation described in the customer-supplied encryption keys section. Because of the importance of the first write to state after state migration, you should not delete old KMS keys until any state file(s) encrypted with that key update.
|
||||
|
||||
Customer-managed keys do not need to be sent in requests to read files from GCS buckets because decryption occurs automatically within GCS. This process means that if you use the `terraform_remote_state` [data source](/docs/language/state/remote-state-data) to access KMS-encrypted state, you do not need to specify the KMS key in the data source's `config` object.
|
||||
Customer-managed keys do not need to be sent in requests to read files from GCS buckets because decryption occurs automatically within GCS. This process means that if you use the `terraform_remote_state` [data source](../../../language/state/remote-state-data.mdx) to access KMS-encrypted state, you do not need to specify the KMS key in the data source's `config` object.
|
||||
|
||||
:::warning Important
|
||||
To use customer-managed encryption keys, you need to create a key and give your project's GCS service agent permission to use it with the Cloud KMS CryptoKey Encrypter/Decrypter predefined role.
|
||||
@@ -103,7 +103,7 @@ To use customer-managed encryption keys, you need to create a key and give your
|
||||
## Configuration Variables
|
||||
|
||||
:::danger Warning
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu includes these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](/docs/language/settings/backends/configuration#credentials-and-sensitive-data) for details.
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu includes these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](../../../language/settings/backends/configuration.mdx#credentials-and-sensitive-data) for details.
|
||||
:::
|
||||
|
||||
The following configuration options are supported:
|
||||
|
||||
@@ -9,7 +9,7 @@ Stores the state using a simple [REST](https://en.wikipedia.org/wiki/Representat
|
||||
|
||||
State will be fetched via GET, updated via POST, and purged with DELETE. The method used for updating is configurable.
|
||||
|
||||
This backend optionally supports [state locking](/docs/language/state/locking). When locking
|
||||
This backend optionally supports [state locking](../../../language/state/locking.mdx). When locking
|
||||
support is enabled it will use LOCK and UNLOCK requests providing the lock info in the body. The
|
||||
endpoint should return a 423: Locked or 409: Conflict with the holding lock info when it's already
|
||||
taken, 200: OK for success. Any other status will be considered an error. The ID of the holding lock
|
||||
@@ -41,7 +41,7 @@ data "terraform_remote_state" "foo" {
|
||||
## Configuration Variables
|
||||
|
||||
:::danger Warning
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](/docs/language/settings/backends/configuration#credentials-and-sensitive-data) for details.
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](../../../language/settings/backends/configuration.mdx#credentials-and-sensitive-data) for details.
|
||||
:::
|
||||
|
||||
The following configuration options / environment variables are supported:
|
||||
|
||||
@@ -11,7 +11,7 @@ This backend is limited by Kubernetes' maximum Secret size of 1MB. See [Secret r
|
||||
|
||||
Stores the state in a [Kubernetes secret](https://kubernetes.io/docs/concepts/configuration/secret/).
|
||||
|
||||
This backend supports [state locking](/docs/language/state/locking), with locking done using a Lease resource.
|
||||
This backend supports [state locking](../../../language/state/locking.mdx), with locking done using a Lease resource.
|
||||
|
||||
## Example Configuration
|
||||
|
||||
@@ -32,7 +32,7 @@ If the `in_cluster_config` flag is set the backend will attempt to use a [servic
|
||||
|
||||
For most use cases either `in_cluster_config`, `config_path`, or `config_paths` will need to be set. If all flags are set the configuration at `config_path` will be used.
|
||||
|
||||
Note that for the access credentials we recommend using a [partial configuration](/docs/language/settings/backends/configuration#partial-configuration).
|
||||
Note that for the access credentials we recommend using a [partial configuration](../../../language/settings/backends/configuration.mdx#partial-configuration).
|
||||
|
||||
## Example Referencing
|
||||
|
||||
@@ -49,7 +49,7 @@ data "terraform_remote_state" "foo" {
|
||||
## Configuration Variables
|
||||
|
||||
:::danger Warning
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](/docs/language/settings/backends/configuration#credentials-and-sensitive-data) for details.
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](../../../language/settings/backends/configuration.mdx#credentials-and-sensitive-data) for details.
|
||||
:::
|
||||
|
||||
The following configuration options are supported:
|
||||
|
||||
@@ -79,7 +79,7 @@ the three arguments would typically all be paths within a temporary
|
||||
directory used just for one operation.
|
||||
|
||||
Because these old workflows predate the introduction of the possibility of
|
||||
[multiple workspaces](/docs/language/state/workspaces), setting them
|
||||
[multiple workspaces](../../../language/state/workspaces.mdx), setting them
|
||||
overrides OpenTofu's usual behavior of selecting a different state filename
|
||||
based on the selected workspace. If you use all three of these options then
|
||||
the selected workspace has no effect on which filenames OpenTofu will select
|
||||
@@ -91,7 +91,7 @@ backend type selected.
|
||||
|
||||
We do not recommend using these options in new systems, even if you are running
|
||||
OpenTofu in automation. Instead,
|
||||
[select a different backend which supports remote state](/docs/language/settings/backends/configuration) and configure it
|
||||
[select a different backend which supports remote state](../../../language/settings/backends/configuration.mdx) and configure it
|
||||
within your root module, which ensures that everyone working on your
|
||||
configuration will automatically retrieve and store state in the correct shared
|
||||
location without any special command line options.
|
||||
|
||||
@@ -11,7 +11,7 @@ This backend also supports state locking and consistency checking via
|
||||
[Alibaba Cloud Table Store](https://www.alibabacloud.com/help/doc-detail/27280.htm), which can be enabled by setting
|
||||
the `tablestore_table` field to an existing TableStore table name.
|
||||
|
||||
This backend supports [state locking](/docs/language/state/locking) via TableStore.
|
||||
This backend supports [state locking](../../../language/state/locking.mdx) via TableStore.
|
||||
|
||||
## Example Configuration
|
||||
|
||||
@@ -37,7 +37,7 @@ OpenTofu state will be written into the file `path/mystate/version-1.tfstate`. T
|
||||
|
||||
To make use of the OSS remote state in another configuration, use the
|
||||
[`terraform_remote_state` data
|
||||
source](/docs/language/state/remote-state-data).
|
||||
source](../../../language/state/remote-state-data/index.mdx).
|
||||
|
||||
```hcl
|
||||
terraform {
|
||||
@@ -70,7 +70,7 @@ data "terraform_remote_state" "network" {
|
||||
## Configuration Variables
|
||||
|
||||
:::danger Warning
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](/docs/language/settings/backends/configuration#credentials-and-sensitive-data) for details.
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](../../../language/settings/backends/configuration.mdx#credentials-and-sensitive-data) for details.
|
||||
:::
|
||||
|
||||
The following configuration options or environment variables are supported:
|
||||
|
||||
@@ -7,7 +7,7 @@ description: OpenTofu can store state remotely in a Postgres database with locki
|
||||
|
||||
Stores the state in a [Postgres database](https://www.postgresql.org) version 10 or newer.
|
||||
|
||||
This backend supports [state locking](/docs/language/state/locking).
|
||||
This backend supports [state locking](../../../language/state/locking.mdx).
|
||||
|
||||
## Example Configuration
|
||||
|
||||
@@ -69,7 +69,7 @@ $ tofu init
|
||||
|
||||
## Data Source Configuration
|
||||
|
||||
To make use of the pg remote state in another configuration, use the [`terraform_remote_state` data source](/docs/language/state/remote-state-data).
|
||||
To make use of the pg remote state in another configuration, use the [`terraform_remote_state` data source](../../../language/state/remote-state-data.mdx).
|
||||
|
||||
```hcl
|
||||
data "terraform_remote_state" "network" {
|
||||
@@ -83,7 +83,7 @@ data "terraform_remote_state" "network" {
|
||||
## Configuration Variables
|
||||
|
||||
:::danger Warning
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](/docs/language/settings/backends/configuration#credentials-and-sensitive-data) for details.
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](../../../language/settings/backends/configuration.mdx#credentials-and-sensitive-data) for details.
|
||||
:::
|
||||
|
||||
The following configuration options or environment variables are supported:
|
||||
@@ -98,9 +98,9 @@ The following configuration options or environment variables are supported:
|
||||
|
||||
This backend creates one table **states** in the automatically-managed Postgres schema configured by the `schema_name` variable.
|
||||
|
||||
The table is keyed by the [workspace](/docs/language/state/workspaces) name. If workspaces are not in use, the name `default` is used.
|
||||
The table is keyed by the [workspace](../../../language/state/workspaces.mdx) name. If workspaces are not in use, the name `default` is used.
|
||||
|
||||
Locking is supported using [Postgres advisory locks](https://www.postgresql.org/docs/9.5/explicit-locking.html#ADVISORY-LOCKS). [`force-unlock`](/docs/cli/commands/force-unlock) is not supported, because these database-native locks will automatically unlock when the session is aborted or the connection fails. To see outstanding locks in a Postgres server, use the [`pg_locks` system view](https://www.postgresql.org/docs/9.5/view-pg-locks.html).
|
||||
Locking is supported using [Postgres advisory locks](https://www.postgresql.org/docs/9.5/explicit-locking.html#ADVISORY-LOCKS). [`force-unlock`](../../../cli/commands/force-unlock.mdx) is not supported, because these database-native locks will automatically unlock when the session is aborted or the connection fails. To see outstanding locks in a Postgres server, use the [`pg_locks` system view](https://www.postgresql.org/docs/9.5/view-pg-locks.html).
|
||||
|
||||
The **states** table contains:
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ description: >-
|
||||
# Backend Type: remote
|
||||
|
||||
:::note
|
||||
**We recommend using the [`cloud` built-in integration](/docs/cli/cloud/settings)** instead of this backend. The `cloud` option includes an improved user experience and more features.
|
||||
**We recommend using the [`cloud` built-in integration](../../../cli/cloud/settings.mdx)** instead of this backend. The `cloud` option includes an improved user experience and more features.
|
||||
:::
|
||||
|
||||
The remote backend is unique among all other OpenTofu backends because it can both store state snapshots and execute CLI-driven run workflow operations for TF Automation and Collaboration Software (TACOS) backends. It used to be called an "enhanced" backend.
|
||||
@@ -56,7 +56,7 @@ determines which mode it uses:
|
||||
all of the desired remote workspace names. For example, set
|
||||
`prefix = "networking-"` to use remote workspaces with
|
||||
names like `networking-dev` and `networking-prod`. This is helpful when
|
||||
mapping multiple OpenTofu CLI [workspaces](/docs/language/state/workspaces)
|
||||
mapping multiple OpenTofu CLI [workspaces](../../../language/state/workspaces.mdx)
|
||||
used in a single OpenTofu configuration to multiple remote workspaces.
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ running any remote operations against them.
|
||||
|
||||
OpenTofu uses shortened names without the common prefix to interact with workspaces on the command line. For example, if `prefix = "networking-"`, use `tofu workspace select prod` to switch to the OpenTofu CLI workspace `prod` within the current configuration. However, remote OpenTofu operations such as `plan` and `apply` for that OpenTofu CLI workspace will take place in the remote workspace `networking-prod`.
|
||||
|
||||
Because of this, the [`terraform.workspace`](/docs/language/state/workspaces#current-workspace-interpolation) interpolation expression produces different results depending on whether a remote workspace is configured to perform operations locally or remotely. For example, in a remote workspace called `networking-prod` created with `prefix = "networking-"` the expression produces the following:
|
||||
Because of this, the [`terraform.workspace`](../../../language/state/workspaces.mdx#current-workspace-interpolation) interpolation expression produces different results depending on whether a remote workspace is configured to perform operations locally or remotely. For example, in a remote workspace called `networking-prod` created with `prefix = "networking-"` the expression produces the following:
|
||||
|
||||
- For local operations, `terraform.workspace` = `prod`
|
||||
- For remote operations, `terraform.workspace`= `networking-prod`
|
||||
@@ -82,8 +82,8 @@ Because of this, the [`terraform.workspace`](/docs/language/state/workspaces#cur
|
||||
|
||||
:::note
|
||||
We recommend omitting the token from the configuration, and instead using
|
||||
[`tofu login`](/docs/cli/commands/login) or manually configuring
|
||||
`credentials` in the [CLI config file](/docs/cli/config/config-file#credentials).
|
||||
[`tofu login`](../../../cli/commands/login.mdx) or manually configuring
|
||||
`credentials` in the [CLI config file](../../../cli/config/config-file.mdx#credentials).
|
||||
:::
|
||||
|
||||
### Basic Configuration
|
||||
@@ -159,7 +159,7 @@ data "terraform_remote_state" "foo" {
|
||||
## Configuration Variables
|
||||
|
||||
:::danger Warning
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](/docs/language/settings/backends/configuration#credentials-and-sensitive-data) for details.
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](../../../language/settings/backends/configuration.mdx#credentials-and-sensitive-data) for details.
|
||||
:::
|
||||
|
||||
The following configuration options are supported:
|
||||
@@ -169,9 +169,9 @@ The following configuration options are supported:
|
||||
targeted workspace(s).
|
||||
- `token` - (Optional) The token used to authenticate with the remote backend.
|
||||
We recommend omitting the token from the configuration, and instead using
|
||||
[`tofu login`](/docs/cli/commands/login) or manually configuring
|
||||
[`tofu login`](../../../cli/commands/login.mdx) or manually configuring
|
||||
`credentials` in the
|
||||
[CLI config file](/docs/cli/config/config-file#credentials).
|
||||
[CLI config file](../../../cli/config/config-file.mdx#credentials).
|
||||
- `workspaces` - (Required) A block specifying which remote workspace(s) to use.
|
||||
The `workspaces` block supports the following keys:
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ This assumes we have a bucket created called `mybucket`. The
|
||||
OpenTofu state is written to the key `path/to/my/key`.
|
||||
|
||||
Note that for the access credentials we recommend using a
|
||||
[partial configuration](/docs/language/settings/backends/configuration#partial-configuration).
|
||||
[partial configuration](../../../language/settings/backends/configuration.mdx#partial-configuration).
|
||||
|
||||
### S3 Bucket Permissions
|
||||
|
||||
@@ -108,7 +108,7 @@ This is seen in the following AWS IAM Statement:
|
||||
## Data Source Configuration
|
||||
|
||||
To make use of the S3 remote state in another configuration, use the
|
||||
[`terraform_remote_state` data source](/docs/language/state/remote-state-data).
|
||||
[`terraform_remote_state` data source](../../../language/state/remote-state-data.mdx).
|
||||
|
||||
```hcl
|
||||
data "terraform_remote_state" "network" {
|
||||
@@ -148,7 +148,7 @@ This backend requires the configuration of the AWS Region and S3 state storage.
|
||||
### Credentials and Shared Configuration
|
||||
|
||||
:::danger Warning
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](/docs/language/settings/backends/configuration#credentials-and-sensitive-data) for details.
|
||||
We recommend using environment variables to supply credentials and other sensitive data. If you use `-backend-config` or hardcode these values directly in your configuration, OpenTofu will include these values in both the `.terraform` subdirectory and in plan files. Refer to [Credentials and Sensitive Data](../../../language/settings/backends/configuration.mdx#credentials-and-sensitive-data) for details.
|
||||
:::
|
||||
|
||||
The following configuration is required:
|
||||
@@ -333,7 +333,7 @@ terraform {
|
||||
The following configuration is required:
|
||||
|
||||
* `bucket` - (Required) Name of the S3 Bucket.
|
||||
* `key` - (Required) Path to the state file inside the S3 Bucket. When using a non-default [workspace](/docs/language/state/workspaces), the state path will be `/workspace_key_prefix/workspace_name/key` (see also the `workspace_key_prefix` configuration).
|
||||
* `key` - (Required) Path to the state file inside the S3 Bucket. When using a non-default [workspace](../../../language/state/workspaces.mdx), the state path will be `/workspace_key_prefix/workspace_name/key` (see also the `workspace_key_prefix` configuration).
|
||||
|
||||
The following configuration is optional:
|
||||
|
||||
@@ -366,7 +366,7 @@ The S3 backend can be used in a number of different ways that make different
|
||||
tradeoffs between convenience, security, and isolation in such an organization.
|
||||
This section describes one such approach that aims to find a good compromise
|
||||
between these tradeoffs, allowing use of
|
||||
[OpenTofu's workspaces feature](/docs/language/state/workspaces) to switch
|
||||
[OpenTofu's workspaces feature](../../../language/state/workspaces.mdx) to switch
|
||||
conveniently between multiple isolated deployments of the same configuration.
|
||||
|
||||
Use this section as a starting-point for your approach, but note that
|
||||
@@ -474,7 +474,7 @@ provider "aws" {
|
||||
|
||||
If workspace IAM roles are centrally managed and shared across many separate
|
||||
OpenTofu configurations, the role ARNs could also be obtained via a data
|
||||
source such as [`terraform_remote_state`](/docs/language/state/remote-state-data)
|
||||
source such as [`terraform_remote_state`](../../../language/state/remote-state-data.mdx)
|
||||
to avoid repeating these values.
|
||||
|
||||
### Creating and Selecting Workspaces
|
||||
|
||||
@@ -12,7 +12,7 @@ behaviors of OpenTofu itself, such as requiring a minimum OpenTofu version to
|
||||
apply your configuration.
|
||||
|
||||
:::note
|
||||
As a part of [OpenTofu v1.x Compatibility Promises](/docs/language/v1-compatibility-promises),
|
||||
As a part of [OpenTofu v1.x Compatibility Promises](../../language/v1-compatibility-promises.mdx),
|
||||
the `terraform` block stays as-is. A `tofu` block may be introduced in the future, but it doesn't
|
||||
exist yet.
|
||||
:::
|
||||
@@ -41,18 +41,18 @@ following sections.
|
||||
The nested `backend` block configures which state backend OpenTofu should use.
|
||||
|
||||
The syntax and behavior of the `backend` block is described in [Backend
|
||||
Configuration](/docs/language/settings/backends/configuration).
|
||||
Configuration](../../language/settings/backends/configuration.mdx).
|
||||
|
||||
## Specifying a Required OpenTofu Version
|
||||
|
||||
The `required_version` setting accepts a [version constraint
|
||||
string,](/docs/language/expressions/version-constraints) which specifies which versions of OpenTofu
|
||||
string,](../../language/expressions/version-constraints.mdx) which specifies which versions of OpenTofu
|
||||
can be used with your configuration.
|
||||
|
||||
If the running version of OpenTofu doesn't match the constraints specified,
|
||||
OpenTofu will produce an error and exit without taking any further actions.
|
||||
|
||||
When you use [child modules](/docs/language/modules), each module can specify its own
|
||||
When you use [child modules](../../language/modules/index.mdx), each module can specify its own
|
||||
version requirements. The requirements of all modules in the tree must be
|
||||
satisfied.
|
||||
|
||||
@@ -63,7 +63,7 @@ a minimum OpenTofu version that has behavior expected by the configuration.
|
||||
The `required_version` setting applies only to the version of OpenTofu CLI.
|
||||
OpenTofu's resource types are implemented by provider plugins,
|
||||
whose release cycles are independent of OpenTofu CLI and of each other.
|
||||
Use [the `required_providers` block](/docs/language/providers/requirements) to manage
|
||||
Use [the `required_providers` block](../../language/providers/requirements.mdx) to manage
|
||||
the expected versions for each provider you use.
|
||||
|
||||
## Specifying Provider Requirements
|
||||
@@ -83,7 +83,7 @@ terraform {
|
||||
}
|
||||
```
|
||||
|
||||
For more information, see [Provider Requirements](/docs/language/providers/requirements).
|
||||
For more information, see [Provider Requirements](../../language/providers/requirements.mdx).
|
||||
|
||||
## Experimental Language Features
|
||||
|
||||
@@ -128,4 +128,4 @@ provider a module is using, if the provider defines a schema for it. This
|
||||
allows the provider to receive module-specific information, and is primarily
|
||||
intended for modules distributed by the same vendor as the associated provider.
|
||||
|
||||
For more information, see [Provider Metadata](/docs/internals/provider-meta).
|
||||
For more information, see [Provider Metadata](../../internals/provider-meta.mdx).
|
||||
|
||||
@@ -5,14 +5,14 @@ description: >-
|
||||
|
||||
# Cloud Configuration
|
||||
|
||||
The main module of an OpenTofu configuration can integrate with a cloud backend to enable its [CLI-driven run workflow](/docs/cli/cloud) (if supported by your cloud backend). You only need to configure these settings when you want to use OpenTofu CLI to interact with a cloud backend.
|
||||
The main module of an OpenTofu configuration can integrate with a cloud backend to enable its [CLI-driven run workflow](../../cli/cloud/index.mdx) (if supported by your cloud backend). You only need to configure these settings when you want to use OpenTofu CLI to interact with a cloud backend.
|
||||
A cloud backend ignores them when interacting with OpenTofu through version control or the API.
|
||||
|
||||
## Usage Example
|
||||
|
||||
To configure the cloud CLI integration, add a nested `cloud` block within the `terraform` block. You cannot use the CLI integration and a state backend in the same configuration.
|
||||
|
||||
Refer to [Using the Cloud Backend](/docs/cli/cloud) in the OpenTofu CLI documentation for full configuration details, migration instructions, and command line arguments.
|
||||
Refer to [Using the Cloud Backend](../../cli/cloud/index.mdx) in the OpenTofu CLI documentation for full configuration details, migration instructions, and command line arguments.
|
||||
|
||||
```hcl
|
||||
terraform {
|
||||
|
||||
Reference in New Issue
Block a user