Skip to main content
The Cloud Backend synthesizes a 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

Initializer

import cdktn

cdktn.CloudBackendConfig(
  organization: str,
  workspaces: NamedCloudWorkspace | TaggedCloudWorkspaces,
  hostname: str = None,
  token: str = None
)

Properties

NameTypeDescription
organizationstrThe name of the organization containing the workspace(s) the current configuration should use.
workspacesNamedCloudWorkspace | TaggedCloudWorkspacesA nested block that specifies which remote Terraform Cloud workspaces to use for the current configuration.
hostnamestrThe hostname of a Terraform Enterprise installation, if using Terraform Enterprise.
tokenstrThe token used to authenticate with Terraform Cloud.

organizationRequired

organization: str
  • Type: str
The name of the organization containing the workspace(s) the current configuration should use.

workspacesRequired

workspaces: NamedCloudWorkspace | TaggedCloudWorkspaces
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:

hostnameOptional

hostname: str
  • Type: str
  • Default: app.terraform.io
The hostname of a Terraform Enterprise installation, if using Terraform Enterprise.

tokenOptional

token: str
  • Type: str
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.