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

# Java: CloudBackendConfig

> CDKTN Core API Reference for CloudBackendConfig in Java.

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

```java theme={null}
import io.cdktn.cdktn.CloudBackendConfig;

CloudBackendConfig.builder()
    .organization(java.lang.String)
    .workspaces(NamedCloudWorkspace|TaggedCloudWorkspaces)
//  .hostname(java.lang.String)
//  .token(java.lang.String)
    .build();
```

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

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

***

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

```java theme={null}
public java.lang.String getOrganization();
```

* *Type:* java.lang.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" />

```java theme={null}
public NamedCloudWorkspace|TaggedCloudWorkspaces getWorkspaces();
```

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

```java theme={null}
public java.lang.String getHostname();
```

* *Type:* java.lang.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" />

```java theme={null}
public java.lang.String getToken();
```

* *Type:* java.lang.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.

***
