mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Signed-off-by: Christian Mesh <christianmesh1@gmail.com> Signed-off-by: ollevche <ollevche@gmail.com> Co-authored-by: ollevche <ollevche@gmail.com>
37 lines
1.2 KiB
Plaintext
37 lines
1.2 KiB
Plaintext
---
|
|
description: >-
|
|
The nested `cloud` block configures OpenTofu's integration with a cloud backend.
|
|
---
|
|
|
|
# Cloud Configuration
|
|
|
|
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](../../cli/cloud/index.mdx) in the OpenTofu CLI documentation for full configuration details, migration instructions, and command line arguments.
|
|
|
|
```hcl
|
|
locals {
|
|
org = "example_corp"
|
|
}
|
|
|
|
terraform {
|
|
cloud {
|
|
organization = local.org
|
|
hostname = "app.example.io"
|
|
|
|
workspaces {
|
|
tags = ["app"]
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
:::note
|
|
Cloud fields may not contain any references to data in the state or provider defined functions. All values must be able to be resolved during `tofu init` before the state is available.
|
|
:::
|