Skip to main content
TerraformBackend is the base class for all backend configurations.

LocalBackend

Configures a local backend.
new LocalBackend(scope: Construct, config?: LocalBackendConfig)

LocalBackendConfig

PropertyTypeDescription
pathstringPath to the state file.
workspaceDirstringDirectory for workspaces.

S3Backend

Configures an AWS S3 backend.
new S3Backend(scope: Construct, config: S3BackendConfig)

S3BackendConfig

PropertyTypeDescription
bucketstringName of the S3 bucket.
keystringPath to the state file in the bucket.
regionstringAWS region.
encryptbooleanWhether to enable server-side encryption.
dynamodbTablestringDynamoDB table for state locking.

GcsBackend

Configures a Google Cloud Storage backend.
new GcsBackend(scope: Construct, config: GcsBackendConfig)

GcsBackendConfig

PropertyTypeDescription
bucketstringName of the GCS bucket.
prefixstringPrefix for the state file.

RemoteBackend

Configures a Terraform Cloud/Enterprise remote backend (legacy).
new RemoteBackend(scope: Construct, config: RemoteBackendConfig)

RemoteBackendConfig

PropertyTypeDescription
hostnamestringTerraform Cloud/Enterprise hostname.
organizationstringOrganization name.
workspacesRemoteBackendWorkspacesWorkspace configuration.

CloudBackend

Configures the modern Terraform Cloud backend.
new CloudBackend(scope: Construct, config: CloudBackendConfig)

CloudBackendConfig

PropertyTypeDescription
organizationstringOrganization name.
workspacesCloudBackendWorkspacesWorkspace configuration.
hostnamestringTerraform Cloud hostname.