> ## 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: CosBackend

> CDKTN Core API Reference for CosBackend in Java.

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

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

CosBackend.Builder.create(Construct scope)
    .bucket(java.lang.String)
//  .accelerate(java.lang.Boolean)
//  .acl(java.lang.String)
//  .assumeRole(CosBackendAssumeRole)
//  .domain(java.lang.String)
//  .encrypt(java.lang.Boolean)
//  .endpoint(java.lang.String)
//  .key(java.lang.String)
//  .prefix(java.lang.String)
//  .region(java.lang.String)
//  .secretId(java.lang.String)
//  .secretKey(java.lang.String)
//  .securityToken(java.lang.String)
    .build();
```

| **Name**                                                                                       | **Type**                                                                    | **Description**                                                                        |
| ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.scope">scope</a></code>                 | <code>software.constructs.Construct</code>                                  | *No description.*                                                                      |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.bucket">bucket</a></code>               | <code>java.lang.String</code>                                               | (Required) The name of the COS bucket.                                                 |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.accelerate">accelerate</a></code>       | <code>java.lang.Boolean</code>                                              | (Optional) Whether to enable global Acceleration.                                      |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.acl">acl</a></code>                     | <code>java.lang.String</code>                                               | (Optional) Object ACL to be applied to the state file, allows private and public-read. |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.assumeRole">assumeRole</a></code>       | <code><a href="#cdktn.CosBackendAssumeRole">CosBackendAssumeRole</a></code> | (Optional) The assume\_role block.                                                     |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.domain">domain</a></code>               | <code>java.lang.String</code>                                               | (Optional) The root domain of the API request.                                         |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.encrypt">encrypt</a></code>             | <code>java.lang.Boolean</code>                                              | (Optional) Whether to enable server side encryption of the state file.                 |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.endpoint">endpoint</a></code>           | <code>java.lang.String</code>                                               | (Optional) The Custom Endpoint for the COS backend.                                    |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.key">key</a></code>                     | <code>java.lang.String</code>                                               | (Optional) The path for saving the state file in bucket.                               |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.prefix">prefix</a></code>               | <code>java.lang.String</code>                                               | (Optional) The directory for saving the state file in bucket.                          |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.region">region</a></code>               | <code>java.lang.String</code>                                               | (Optional) The region of the COS bucket.                                               |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.secretId">secretId</a></code>           | <code>java.lang.String</code>                                               | (Optional) Secret id of Tencent Cloud.                                                 |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.secretKey">secretKey</a></code>         | <code>java.lang.String</code>                                               | (Optional) Secret key of Tencent Cloud.                                                |
| <code><a href="#cdktn.CosBackend.Initializer.parameter.securityToken">securityToken</a></code> | <code>java.lang.String</code>                                               | (Optional) TencentCloud Security Token of temporary access credentials.                |

***

### `scope`<sup>Required</sup> <a name="scope" id="cdktn.CosBackend.Initializer.parameter.scope" />

* *Type:* software.constructs.Construct

***

### `bucket`<sup>Required</sup> <a name="bucket" id="cdktn.CosBackend.Initializer.parameter.bucket" />

* *Type:* java.lang.String

(Required) The name of the COS bucket.

You shall manually create it first.

***

### `accelerate`<sup>Optional</sup> <a name="accelerate" id="cdktn.CosBackend.Initializer.parameter.accelerate" />

* *Type:* java.lang.Boolean

(Optional) Whether to enable global Acceleration.

Defaults to false.

***

### `acl`<sup>Optional</sup> <a name="acl" id="cdktn.CosBackend.Initializer.parameter.acl" />

* *Type:* java.lang.String

(Optional) Object ACL to be applied to the state file, allows private and public-read.

Defaults to private.

***

### `assumeRole`<sup>Optional</sup> <a name="assumeRole" id="cdktn.CosBackend.Initializer.parameter.assumeRole" />

* *Type:* <a href="#cdktn.CosBackendAssumeRole">CosBackendAssumeRole</a>

(Optional) The assume\_role block.

If provided, terraform will attempt to assume this role using the supplied credentials.

***

### `domain`<sup>Optional</sup> <a name="domain" id="cdktn.CosBackend.Initializer.parameter.domain" />

* *Type:* java.lang.String

(Optional) The root domain of the API request.

Defaults to tencentcloudapi.com.
It supports the environment variable TENCENTCLOUD\_DOMAIN.

***

### `encrypt`<sup>Optional</sup> <a name="encrypt" id="cdktn.CosBackend.Initializer.parameter.encrypt" />

* *Type:* java.lang.Boolean

(Optional) Whether to enable server side encryption of the state file.

If it is true, COS will use 'AES256' encryption algorithm to encrypt state file.

***

### `endpoint`<sup>Optional</sup> <a name="endpoint" id="cdktn.CosBackend.Initializer.parameter.endpoint" />

* *Type:* java.lang.String

(Optional) The Custom Endpoint for the COS backend.

It supports the environment variable TENCENTCLOUD\_ENDPOINT.

***

### `key`<sup>Optional</sup> <a name="key" id="cdktn.CosBackend.Initializer.parameter.key" />

* *Type:* java.lang.String

(Optional) The path for saving the state file in bucket.

Defaults to terraform.tfstate.

***

### `prefix`<sup>Optional</sup> <a name="prefix" id="cdktn.CosBackend.Initializer.parameter.prefix" />

* *Type:* java.lang.String

(Optional) The directory for saving the state file in bucket.

Default to "env:".

***

### `region`<sup>Optional</sup> <a name="region" id="cdktn.CosBackend.Initializer.parameter.region" />

* *Type:* java.lang.String

(Optional) The region of the COS bucket.

It supports environment variables TENCENTCLOUD\_REGION.

***

### `secretId`<sup>Optional</sup> <a name="secretId" id="cdktn.CosBackend.Initializer.parameter.secretId" />

* *Type:* java.lang.String

(Optional) Secret id of Tencent Cloud.

It supports environment variables TENCENTCLOUD\_SECRET\_ID.

***

### `secretKey`<sup>Optional</sup> <a name="secretKey" id="cdktn.CosBackend.Initializer.parameter.secretKey" />

* *Type:* java.lang.String

(Optional) Secret key of Tencent Cloud.

It supports environment variables TENCENTCLOUD\_SECRET\_KEY.

***

### `securityToken`<sup>Optional</sup> <a name="securityToken" id="cdktn.CosBackend.Initializer.parameter.securityToken" />

* *Type:* java.lang.String

(Optional) TencentCloud Security Token of temporary access credentials.

It supports environment variables TENCENTCLOUD\_SECURITY\_TOKEN.

***

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

| **Name**                                                                                       | **Description**                                                                   |
| ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| <code><a href="#cdktn.CosBackend.toString">toString</a></code>                                 | Returns a string representation of this construct.                                |
| <code><a href="#cdktn.CosBackend.with">with</a></code>                                         | Applies one or more mixins to this construct.                                     |
| <code><a href="#cdktn.CosBackend.addOverride">addOverride</a></code>                           | *No description.*                                                                 |
| <code><a href="#cdktn.CosBackend.overrideLogicalId">overrideLogicalId</a></code>               | Overrides the auto-generated logical ID with a specific ID.                       |
| <code><a href="#cdktn.CosBackend.resetOverrideLogicalId">resetOverrideLogicalId</a></code>     | Resets a previously passed logical Id to use the auto-generated logical id again. |
| <code><a href="#cdktn.CosBackend.toHclTerraform">toHclTerraform</a></code>                     | *No description.*                                                                 |
| <code><a href="#cdktn.CosBackend.toMetadata">toMetadata</a></code>                             | *No description.*                                                                 |
| <code><a href="#cdktn.CosBackend.toTerraform">toTerraform</a></code>                           | Adds this resource to the terraform JSON output.                                  |
| <code><a href="#cdktn.CosBackend.getRemoteStateDataSource">getRemoteStateDataSource</a></code> | Creates a TerraformRemoteState resource that accesses this backend.               |

***

### `toString` <a name="toString" id="cdktn.CosBackend.toString" />

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

Returns a string representation of this construct.

### `with` <a name="with" id="cdktn.CosBackend.with" />

```java theme={null}
public IConstruct with(IMixin... mixins)
```

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple `with()` calls if subsequent mixins should apply to added
constructs.

#### `mixins`<sup>Required</sup> <a name="mixins" id="cdktn.CosBackend.with.parameter.mixins" />

* *Type:* software.constructs.IMixin...

The mixins to apply.

***

### `addOverride` <a name="addOverride" id="cdktn.CosBackend.addOverride" />

```java theme={null}
public void addOverride(java.lang.String path, java.lang.Object value)
```

#### `path`<sup>Required</sup> <a name="path" id="cdktn.CosBackend.addOverride.parameter.path" />

* *Type:* java.lang.String

***

#### `value`<sup>Required</sup> <a name="value" id="cdktn.CosBackend.addOverride.parameter.value" />

* *Type:* java.lang.Object

***

### `overrideLogicalId` <a name="overrideLogicalId" id="cdktn.CosBackend.overrideLogicalId" />

```java theme={null}
public void overrideLogicalId(java.lang.String newLogicalId)
```

Overrides the auto-generated logical ID with a specific ID.

#### `newLogicalId`<sup>Required</sup> <a name="newLogicalId" id="cdktn.CosBackend.overrideLogicalId.parameter.newLogicalId" />

* *Type:* java.lang.String

The new logical ID to use for this stack element.

***

### `resetOverrideLogicalId` <a name="resetOverrideLogicalId" id="cdktn.CosBackend.resetOverrideLogicalId" />

```java theme={null}
public void resetOverrideLogicalId()
```

Resets a previously passed logical Id to use the auto-generated logical id again.

### `toHclTerraform` <a name="toHclTerraform" id="cdktn.CosBackend.toHclTerraform" />

```java theme={null}
public java.lang.Object toHclTerraform()
```

### `toMetadata` <a name="toMetadata" id="cdktn.CosBackend.toMetadata" />

```java theme={null}
public java.lang.Object toMetadata()
```

### `toTerraform` <a name="toTerraform" id="cdktn.CosBackend.toTerraform" />

```java theme={null}
public java.lang.Object toTerraform()
```

Adds this resource to the terraform JSON output.

### `getRemoteStateDataSource` <a name="getRemoteStateDataSource" id="cdktn.CosBackend.getRemoteStateDataSource" />

```java theme={null}
public TerraformRemoteState getRemoteStateDataSource(Construct scope, java.lang.String name, java.lang.String _fromStack)
```

Creates a TerraformRemoteState resource that accesses this backend.

#### `scope`<sup>Required</sup> <a name="scope" id="cdktn.CosBackend.getRemoteStateDataSource.parameter.scope" />

* *Type:* software.constructs.Construct

***

#### `name`<sup>Required</sup> <a name="name" id="cdktn.CosBackend.getRemoteStateDataSource.parameter.name" />

* *Type:* java.lang.String

***

#### `_fromStack`<sup>Required</sup> <a name="_fromStack" id="cdktn.CosBackend.getRemoteStateDataSource.parameter._fromStack" />

* *Type:* java.lang.String

***

## Static Functions <a name="Static Functions" id="Static Functions" />

| **Name**                                                                           | **Description**               |
| ---------------------------------------------------------------------------------- | ----------------------------- |
| <code><a href="#cdktn.CosBackend.isConstruct">isConstruct</a></code>               | Checks if `x` is a construct. |
| <code><a href="#cdktn.CosBackend.isTerraformElement">isTerraformElement</a></code> | *No description.*             |
| <code><a href="#cdktn.CosBackend.isBackend">isBackend</a></code>                   | *No description.*             |

***

### `isConstruct` <a name="isConstruct" id="cdktn.CosBackend.isConstruct" />

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

CosBackend.isConstruct(java.lang.Object x)
```

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct`
instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on
disk are seen as independent, completely different libraries. As a
consequence, the class `Construct` in each copy of the `constructs` library
is seen as a different class, and an instance of one class will not test as
`instanceof` the other class. `npm install` will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the `constructs`
library can be accidentally installed, and `instanceof` will behave
unpredictably. It is safest to avoid using `instanceof`, and using
this type-testing method instead.

#### `x`<sup>Required</sup> <a name="x" id="cdktn.CosBackend.isConstruct.parameter.x" />

* *Type:* java.lang.Object

Any object.

***

### `isTerraformElement` <a name="isTerraformElement" id="cdktn.CosBackend.isTerraformElement" />

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

CosBackend.isTerraformElement(java.lang.Object x)
```

#### `x`<sup>Required</sup> <a name="x" id="cdktn.CosBackend.isTerraformElement.parameter.x" />

* *Type:* java.lang.Object

***

### `isBackend` <a name="isBackend" id="cdktn.CosBackend.isBackend" />

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

CosBackend.isBackend(java.lang.Object x)
```

#### `x`<sup>Required</sup> <a name="x" id="cdktn.CosBackend.isBackend.parameter.x" />

* *Type:* java.lang.Object

***

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

| **Name**                                                                                | **Type**                                                        | **Description**   |
| --------------------------------------------------------------------------------------- | --------------------------------------------------------------- | ----------------- |
| <code><a href="#cdktn.CosBackend.property.node">node</a></code>                         | <code>software.constructs.Node</code>                           | The tree node.    |
| <code><a href="#cdktn.CosBackend.property.cdktfStack">cdktfStack</a></code>             | <code><a href="#cdktn.TerraformStack">TerraformStack</a></code> | *No description.* |
| <code><a href="#cdktn.CosBackend.property.fqn">fqn</a></code>                           | <code>java.lang.String</code>                                   | *No description.* |
| <code><a href="#cdktn.CosBackend.property.friendlyUniqueId">friendlyUniqueId</a></code> | <code>java.lang.String</code>                                   | *No description.* |

***

### `node`<sup>Required</sup> <a name="node" id="cdktn.CosBackend.property.node" />

```java theme={null}
public Node getNode();
```

* *Type:* software.constructs.Node

The tree node.

***

### `cdktfStack`<sup>Required</sup> <a name="cdktfStack" id="cdktn.CosBackend.property.cdktfStack" />

```java theme={null}
public TerraformStack getCdktfStack();
```

* *Type:* <a href="#cdktn.TerraformStack">TerraformStack</a>

***

### `fqn`<sup>Required</sup> <a name="fqn" id="cdktn.CosBackend.property.fqn" />

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

* *Type:* java.lang.String

***

### `friendlyUniqueId`<sup>Required</sup> <a name="friendlyUniqueId" id="cdktn.CosBackend.property.friendlyUniqueId" />

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

* *Type:* java.lang.String

***
