> ## 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.

# Typescript: CloudBackendConfig

> CDKTN Core API Reference for CloudBackendConfig in Typescript.

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" />

```typescript theme={null}
import { CloudBackendConfig } from 'cdktn'

const cloudBackendConfig: CloudBackendConfig = { ... }
```

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

| **Name**                                                                                | **Type**                                                                                                                                      | **Description**                                                                                             |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.CloudBackendConfig.property.organization">organization</a></code> | <code>string</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>string</code>                                                                                                                           | The hostname of a Terraform Enterprise installation, if using Terraform Enterprise.                         |
| <code><a href="#cdktn.CloudBackendConfig.property.token">token</a></code>               | <code>string</code>                                                                                                                           | The token used to authenticate with Terraform Cloud.                                                        |

***

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

```typescript theme={null}
public readonly organization: string;
```

* *Type:* string

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" />

```typescript theme={null}
public readonly 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" />

```typescript theme={null}
public readonly hostname: string;
```

* *Type:* string
* *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" />

```typescript theme={null}
public readonly token: string;
```

* *Type:* string

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.

***
