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 io.cdktn.cdktn.CloudBackendConfig;

CloudBackendConfig.builder()
    .organization(java.lang.String)
    .workspaces(NamedCloudWorkspace|TaggedCloudWorkspaces)
//  .hostname(java.lang.String)
//  .token(java.lang.String)
    .build();

Properties

NameTypeDescription
organizationjava.lang.StringThe 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.
hostnamejava.lang.StringThe hostname of a Terraform Enterprise installation, if using Terraform Enterprise.
tokenjava.lang.StringThe token used to authenticate with Terraform Cloud.

organizationRequired

public java.lang.String getOrganization();
  • Type: java.lang.String
The name of the organization containing the workspace(s) the current configuration should use.

workspacesRequired

public NamedCloudWorkspace|TaggedCloudWorkspaces getWorkspaces();
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 java.lang.String getHostname();
  • Type: java.lang.String
  • Default: app.terraform.io
The hostname of a Terraform Enterprise installation, if using Terraform Enterprise.

tokenOptional

public java.lang.String getToken();
  • Type: java.lang.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.