> ## Documentation Index
> Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Python: CloudBackendConfig

> CDKTN Core API Reference for CloudBackendConfig in Python.

The Cloud Backend synthesizes a [cloud block](https://developer.hashicorp.com/terraform/cli/cloud/settings#the-cloud-block). The cloud block is a nested block within the top-level terraform settings block. It specifies which Terraform Cloud workspaces to use for the current working directory. The cloud block only affects Terraform CLI's behavior. When Terraform Cloud uses a configuration that contains a cloud block - for example, when a workspace is configured to use a VCS provider directly - it ignores the block and behaves according to its own workspace settings.

[https://developer.hashicorp.com/terraform/cli/cloud/settings#arguments](https://developer.hashicorp.com/terraform/cli/cloud/settings#arguments)

## Initializer <a name="Initializer" id="cdktn.CloudBackendConfig.Initializer" />

```python theme={null}
import cdktn

cdktn.CloudBackendConfig(
  organization: str,
  workspaces: NamedCloudWorkspace | TaggedCloudWorkspaces,
  hostname: str = None,
  token: str = None
)
```

## Properties <a name="Properties" id="Properties" />

| **Name**                                                                                | **Type**                                                                                                                                      | **Description**                                                                                             |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.CloudBackendConfig.property.organization">organization</a></code> | <code>str</code>                                                                                                                              | The name of the organization containing the workspace(s) the current configuration should use.              |
| <code><a href="#cdktn.CloudBackendConfig.property.workspaces">workspaces</a></code>     | <code><a href="#cdktn.NamedCloudWorkspace">NamedCloudWorkspace</a> \| <a href="#cdktn.TaggedCloudWorkspaces">TaggedCloudWorkspaces</a></code> | A nested block that specifies which remote Terraform Cloud workspaces to use for the current configuration. |
| <code><a href="#cdktn.CloudBackendConfig.property.hostname">hostname</a></code>         | <code>str</code>                                                                                                                              | The hostname of a Terraform Enterprise installation, if using Terraform Enterprise.                         |
| <code><a href="#cdktn.CloudBackendConfig.property.token">token</a></code>               | <code>str</code>                                                                                                                              | The token used to authenticate with Terraform Cloud.                                                        |

***

### `organization`<sup>Required</sup> <a name="organization" id="cdktn.CloudBackendConfig.property.organization" />

```python theme={null}
organization: str
```

* *Type:* str

The name of the organization containing the workspace(s) the current configuration should use.

***

### `workspaces`<sup>Required</sup> <a name="workspaces" id="cdktn.CloudBackendConfig.property.workspaces" />

```python theme={null}
workspaces: NamedCloudWorkspace | TaggedCloudWorkspaces
```

* *Type:* <a href="#cdktn.NamedCloudWorkspace">NamedCloudWorkspace</a> | <a href="#cdktn.TaggedCloudWorkspaces">TaggedCloudWorkspaces</a>

A nested block that specifies which remote Terraform Cloud workspaces to use for the current configuration.

The workspaces block must contain exactly one of the following arguments, each denoting a strategy for how workspaces should be mapped:

***

### `hostname`<sup>Optional</sup> <a name="hostname" id="cdktn.CloudBackendConfig.property.hostname" />

```python theme={null}
hostname: str
```

* *Type:* str
* *Default:* app.terraform.io

The hostname of a Terraform Enterprise installation, if using Terraform Enterprise.

***

### `token`<sup>Optional</sup> <a name="token" id="cdktn.CloudBackendConfig.property.token" />

```python theme={null}
token: str
```

* *Type:* str

The token used to authenticate with Terraform Cloud.

We recommend omitting the token from the configuration, and instead using terraform login or manually configuring credentials in the CLI config file.

***
