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

> CDKTN Core API Reference for OssBackend in Java.

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

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

OssBackend.Builder.create(Construct scope)
    .bucket(java.lang.String)
//  .accessKey(java.lang.String)
//  .acl(java.lang.String)
//  .assumeRole(OssAssumeRole)
//  .assumeRolePolicy(java.lang.String)
//  .assumeRoleRoleArn(java.lang.String)
//  .assumeRoleSessionExpiration(java.lang.Number)
//  .assumeRoleSessionName(java.lang.String)
//  .ecsRoleName(java.lang.String)
//  .encrypt(java.lang.Boolean)
//  .endpoint(java.lang.String)
//  .key(java.lang.String)
//  .prefix(java.lang.String)
//  .profile(java.lang.String)
//  .region(java.lang.String)
//  .secretKey(java.lang.String)
//  .securityToken(java.lang.String)
//  .sharedCredentialsFile(java.lang.String)
//  .stsEndpoint(java.lang.String)
//  .tablestoreEndpoint(java.lang.String)
//  .tablestoreTable(java.lang.String)
    .build();
```

| **Name**                                                                                                                   | **Type**                                                      | **Description**                                                                                                                                                                                                                                                                                                  |
| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.scope">scope</a></code>                                             | <code>software.constructs.Construct</code>                    | *No description.*                                                                                                                                                                                                                                                                                                |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.bucket">bucket</a></code>                                           | <code>java.lang.String</code>                                 | (Required) The name of the OSS bucket.                                                                                                                                                                                                                                                                           |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.accessKey">accessKey</a></code>                                     | <code>java.lang.String</code>                                 | (Optional) Alibaba Cloud access key.                                                                                                                                                                                                                                                                             |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.acl">acl</a></code>                                                 | <code>java.lang.String</code>                                 | (Optional) Object ACL to be applied to the state file.                                                                                                                                                                                                                                                           |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.assumeRole">assumeRole</a></code>                                   | <code><a href="#cdktn.OssAssumeRole">OssAssumeRole</a></code> | *No description.*                                                                                                                                                                                                                                                                                                |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.assumeRolePolicy">assumeRolePolicy</a></code>                       | <code>java.lang.String</code>                                 | (Optional, Available in 1.1.0+) A more restrictive policy to apply to the temporary credentials. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use this policy to grant permissions that exceed those of the role that is being assumed. |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.assumeRoleRoleArn">assumeRoleRoleArn</a></code>                     | <code>java.lang.String</code>                                 | (Optional, Available in 1.1.0+) The ARN of the role to assume. If ARN is set to an empty string, it does not perform role switching. It supports the environment variable ALICLOUD\_ASSUME\_ROLE\_ARN. Terraform executes configuration on account with provided credentials.                                    |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.assumeRoleSessionExpiration">assumeRoleSessionExpiration</a></code> | <code>java.lang.Number</code>                                 | (Optional, Available in 1.1.0+) The time after which the established session for assuming role expires. Valid value range: \[900-3600] seconds. Default to 3600 (in this case Alibaba Cloud uses its own default value). It supports environment variable ALICLOUD\_ASSUME\_ROLE\_SESSION\_EXPIRATION.           |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.assumeRoleSessionName">assumeRoleSessionName</a></code>             | <code>java.lang.String</code>                                 | (Optional, Available in 1.1.0+) The session name to use when assuming the role. If omitted, 'terraform' is passed to the AssumeRole call as session name. It supports environment variable ALICLOUD\_ASSUME\_ROLE\_SESSION\_NAME.                                                                                |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.ecsRoleName">ecsRoleName</a></code>                                 | <code>java.lang.String</code>                                 | (Optional, Available in 0.12.14+) The RAM Role Name attached on a ECS instance for API operations. You can retrieve this from the 'Access Control' section of the Alibaba Cloud console.                                                                                                                         |
| <code><a href="#cdktn.OssBackend.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.OssBackend.Initializer.parameter.endpoint">endpoint</a></code>                                       | <code>java.lang.String</code>                                 | (Optional) A custom endpoint for the OSS API.                                                                                                                                                                                                                                                                    |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.key">key</a></code>                                                 | <code>java.lang.String</code>                                 | (Optional) The name of the state file.                                                                                                                                                                                                                                                                           |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.prefix">prefix</a></code>                                           | <code>java.lang.String</code>                                 | (Optional) The path directory of the state file will be stored.                                                                                                                                                                                                                                                  |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.profile">profile</a></code>                                         | <code>java.lang.String</code>                                 | (Optional, Available in 0.12.8+) This is the Alibaba Cloud profile name as set in the shared credentials file. It can also be sourced from the ALICLOUD\_PROFILE environment variable.                                                                                                                           |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.region">region</a></code>                                           | <code>java.lang.String</code>                                 | (Optional) The region of the OSS bucket.                                                                                                                                                                                                                                                                         |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.secretKey">secretKey</a></code>                                     | <code>java.lang.String</code>                                 | (Optional) Alibaba Cloud secret access key.                                                                                                                                                                                                                                                                      |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.securityToken">securityToken</a></code>                             | <code>java.lang.String</code>                                 | (Optional) STS access token.                                                                                                                                                                                                                                                                                     |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.sharedCredentialsFile">sharedCredentialsFile</a></code>             | <code>java.lang.String</code>                                 | (Optional, Available in 0.12.8+) This is the path to the shared credentials file. It can also be sourced from the ALICLOUD\_SHARED\_CREDENTIALS\_FILE environment variable. If this is not set and a profile is specified, \~/.aliyun/config.json will be used.                                                  |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.stsEndpoint">stsEndpoint</a></code>                                 | <code>java.lang.String</code>                                 | (Optional, Available in 1.0.11+) Custom endpoint for the AliCloud Security Token Service (STS) API. It supports environment variable ALICLOUD\_STS\_ENDPOINT.                                                                                                                                                    |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.tablestoreEndpoint">tablestoreEndpoint</a></code>                   | <code>java.lang.String</code>                                 | (Optional) A custom endpoint for the TableStore API.                                                                                                                                                                                                                                                             |
| <code><a href="#cdktn.OssBackend.Initializer.parameter.tablestoreTable">tablestoreTable</a></code>                         | <code>java.lang.String</code>                                 | (Optional) A TableStore table for state locking and consistency.                                                                                                                                                                                                                                                 |

***

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

* *Type:* software.constructs.Construct

***

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

* *Type:* java.lang.String

(Required) The name of the OSS bucket.

***

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

* *Type:* java.lang.String

(Optional) Alibaba Cloud access key.

It supports environment variables ALICLOUD\_ACCESS\_KEY and ALICLOUD\_ACCESS\_KEY\_ID.

***

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

* *Type:* java.lang.String

(Optional) Object ACL to be applied to the state file.

***

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

* *Deprecated:* Use flattened assume role options

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

***

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

* *Type:* java.lang.String

(Optional, Available in 1.1.0+) A more restrictive policy to apply to the temporary credentials. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use this policy to grant permissions that exceed those of the role that is being assumed.

***

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

* *Type:* java.lang.String

(Optional, Available in 1.1.0+) The ARN of the role to assume. If ARN is set to an empty string, it does not perform role switching. It supports the environment variable ALICLOUD\_ASSUME\_ROLE\_ARN. Terraform executes configuration on account with provided credentials.

***

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

* *Type:* java.lang.Number

(Optional, Available in 1.1.0+) The time after which the established session for assuming role expires. Valid value range: \[900-3600] seconds. Default to 3600 (in this case Alibaba Cloud uses its own default value). It supports environment variable ALICLOUD\_ASSUME\_ROLE\_SESSION\_EXPIRATION.

***

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

* *Type:* java.lang.String

(Optional, Available in 1.1.0+) The session name to use when assuming the role. If omitted, 'terraform' is passed to the AssumeRole call as session name. It supports environment variable ALICLOUD\_ASSUME\_ROLE\_SESSION\_NAME.

***

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

* *Type:* java.lang.String

(Optional, Available in 0.12.14+) The RAM Role Name attached on a ECS instance for API operations. You can retrieve this from the 'Access Control' section of the Alibaba Cloud console.

***

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

* *Type:* java.lang.Boolean

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

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

***

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

* *Type:* java.lang.String

(Optional) A custom endpoint for the OSS API.

It supports environment variables ALICLOUD\_OSS\_ENDPOINT and OSS\_ENDPOINT.

***

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

* *Type:* java.lang.String

(Optional) The name of the state file.

Defaults to terraform.tfstate.

***

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

* *Type:* java.lang.String

(Optional) The path directory of the state file will be stored.

Default to "env:".

***

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

* *Type:* java.lang.String

(Optional, Available in 0.12.8+) This is the Alibaba Cloud profile name as set in the shared credentials file. It can also be sourced from the ALICLOUD\_PROFILE environment variable.

***

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

* *Type:* java.lang.String

(Optional) The region of the OSS bucket.

It supports environment variables ALICLOUD\_REGION and ALICLOUD\_DEFAULT\_REGION.

***

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

* *Type:* java.lang.String

(Optional) Alibaba Cloud secret access key.

It supports environment variables ALICLOUD\_SECRET\_KEY and ALICLOUD\_ACCESS\_KEY\_SECRET.

***

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

* *Type:* java.lang.String

(Optional) STS access token.

It supports environment variable ALICLOUD\_SECURITY\_TOKEN.

***

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

* *Type:* java.lang.String

(Optional, Available in 0.12.8+) This is the path to the shared credentials file. It can also be sourced from the ALICLOUD\_SHARED\_CREDENTIALS\_FILE environment variable. If this is not set and a profile is specified, \~/.aliyun/config.json will be used.

***

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

* *Type:* java.lang.String

(Optional, Available in 1.0.11+) Custom endpoint for the AliCloud Security Token Service (STS) API. It supports environment variable ALICLOUD\_STS\_ENDPOINT.

***

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

* *Type:* java.lang.String

(Optional) A custom endpoint for the TableStore API.

***

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

* *Type:* java.lang.String

(Optional) A TableStore table for state locking and consistency.

The table must have a primary key named LockID of type String.

***

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

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

***

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

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

Returns a string representation of this construct.

### `with` <a name="with" id="cdktn.OssBackend.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.OssBackend.with.parameter.mixins" />

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

The mixins to apply.

***

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

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

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

* *Type:* java.lang.String

***

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

* *Type:* java.lang.Object

***

### `overrideLogicalId` <a name="overrideLogicalId" id="cdktn.OssBackend.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.OssBackend.overrideLogicalId.parameter.newLogicalId" />

* *Type:* java.lang.String

The new logical ID to use for this stack element.

***

### `resetOverrideLogicalId` <a name="resetOverrideLogicalId" id="cdktn.OssBackend.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.OssBackend.toHclTerraform" />

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

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

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

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

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

Adds this resource to the terraform JSON output.

### `getRemoteStateDataSource` <a name="getRemoteStateDataSource" id="cdktn.OssBackend.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.OssBackend.getRemoteStateDataSource.parameter.scope" />

* *Type:* software.constructs.Construct

***

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

* *Type:* java.lang.String

***

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

* *Type:* java.lang.String

***

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

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

***

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

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

OssBackend.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.OssBackend.isConstruct.parameter.x" />

* *Type:* java.lang.Object

Any object.

***

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

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

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

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

* *Type:* java.lang.Object

***

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

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

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

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

* *Type:* java.lang.Object

***

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

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

***

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

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

* *Type:* software.constructs.Node

The tree node.

***

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

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

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

***

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

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

* *Type:* java.lang.String

***

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

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

* *Type:* java.lang.String

***
