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

using Io.Cdktn;

new CloudBackendConfig {
    string Organization,
    NamedCloudWorkspace|TaggedCloudWorkspaces Workspaces,
    string Hostname = null,
    string Token = null
};

Properties

NameTypeDescription
OrganizationstringThe 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.
HostnamestringThe hostname of a Terraform Enterprise installation, if using Terraform Enterprise.
TokenstringThe token used to authenticate with Terraform Cloud.

OrganizationRequired

public string Organization { get; set; }
  • Type: string
The name of the organization containing the workspace(s) the current configuration should use.

WorkspacesRequired

public NamedCloudWorkspace|TaggedCloudWorkspaces Workspaces { get; set; }
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

public string Hostname { get; set; }
  • Type: string
  • Default: app.terraform.io
The hostname of a Terraform Enterprise installation, if using Terraform Enterprise.

TokenOptional

public string Token { get; set; }
  • Type: 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.