Skip to main content
Version: Release Next

Terraform Enterprise Plugin

The Digital.ai Release Terraform Enterprise plugin integrates Release with Terraform Enterprise (TFE) and Terraform Cloud. It lets you provision and update infrastructure as part of a release pipeline by managing workspaces, configuration versions, variables, and runs directly from a release flow.

A typical workflow is to create a workspace, upload a Terraform configuration, trigger a run, wait for it to complete, and read the resulting workspace state.

Prerequisites

Before using this plugin, ensure the following:

  • Digital.ai Release 25.1 or later.
  • A running Terraform Enterprise or Terraform Cloud instance.
  • A TFE API token with sufficient permissions for the target organization.
  • The Terraform Enterprise plugin installed in Release. For more information, see Install the Plugin.

Install the Plugin

To install the plugin:

  1. Open Release.
  2. Click the cog icon on the top right.
  3. Select Manage Plugins.
  4. Search for Terraform Enterprise.
  5. Click Install Now next to the Terraform Enterprise plugin.

For more information on plugin installation, see Plugin Manager.


Set up Connection to Terraform Enterprise Server

  1. Log in to Digital.ai Release.
  2. From the navigation pane, under CONFIGURATION, click Connections.
  3. Next to Terraform Enterprise: Server, click add button.
  4. Enter the required details:
FieldDescription
Title (*)Symbolic name for the configuration.
URL (*)Terraform Enterprise host URL (for example, https://app.terraform.io).
Organization (*)Organization name.
API token (*)User or team API token.
  1. If your Digital.ai Release server is behind a proxy, complete the Proxy fields: Proxy host, Proxy port, Proxy username, and Proxy password.
  2. To verify connectivity, click Test.
  3. To save the configuration, click Save.

Terraform Enterprise server connection


Available Tasks

The following tasks are available for the Terraform Enterprise plugin:

Tasks in the Terraform Enterprise plugin include input properties and output properties. Input properties pass in the parameters required for execution, while output properties capture the results returned by Terraform Enterprise.

Output properties can be mapped to Release variables for later use. For more information, see Mapping Task Output Properties to Variables.

note

Fields marked with (*) are mandatory.


Apply Run

This task applies an existing Terraform run, identified by its run ID.

Input Properties

Apply Run Input

FieldDescription
TFE server (*)Terraform Enterprise server connection.
Run ID (*)Run ID to apply.
Wait for completionPoll until the run reaches a terminal state.
Wait timeSeconds between status polls. Default is 30.
Max retriesMaximum number of status polls. Default is 240.

Output Properties

Apply Run Output

FieldDescription
Run status (*)Final terminal status.
Has changesWhether the run detected infrastructure changes.
Apply ID (*)Apply ID.

Create Config Version

This task creates an upload-ready configuration version for a workspace and returns the URL used to upload the Terraform configuration.

Input Properties

Create Config Version Input

FieldDescription
TFE server (*)Terraform Enterprise server connection.
Workspace ID (*)Workspace ID.
SpeculativeLimits this version to speculative (plan-only) runs which cannot be applied.
Auto queue runsAutomatically queue a run when configuration files are uploaded.
ProvisionalDoes not become the current version until the run is applied.

Output Properties

Create Config Version Output

FieldDescription
Configuration version ID (*)Configuration version ID.
Upload URL (*)Upload URL.

Create Run

This task queues a new Terraform plan and apply run against a workspace. When Auto apply is enabled, TFE automatically applies on a successful plan, and the task polls until the run reaches a terminal state (applied, planned_and_finished, errored, canceled, force_canceled, or discarded).

note

This task self-schedules using Release task polling and does not block a server thread while waiting for the run to complete.

Input Properties

Create Run Input

FieldDescription
TFE server (*)Terraform Enterprise server connection.
Workspace ID (*)Workspace ID.
Configuration version IDOmit to use the latest configuration version.
Run messageRun message.
DestroyDestroy all provisioned resources.
Auto applyApply on successful plan and poll until terminal state.
Wait timeSeconds between status polls. Default is 30.
Max retriesMaximum number of status polls. Default is 240.

Output Properties

Create Run Output

FieldDescription
Run ID (*)Run ID.
Run status (*)Final terminal status.
Has changesWhether the run detected infrastructure changes.

Create Variable

This task creates or updates a workspace variable. It supports both Terraform and environment variable categories, as well as HCL-formatted and sensitive values.

Input Properties

Create Variable Input

FieldDescription
TFE server (*)Terraform Enterprise server connection.
Workspace ID (*)Workspace ID.
Variable key (*)Variable key.
SensitiveHides the value in the UI after creation.
Variable valueVariable value.
DescriptionVariable description.
Category (*)Category.
HCLEvaluate value as an HCL expression.

Output Properties

Create Variable Output

FieldDescription
Variable ID (*)Variable ID.

Create Workspace

This task creates a new workspace in the configured TFE organization. Use it to provision a workspace before uploading configuration or triggering a run.

Input Properties

Create Workspace Input

FieldDescription
TFE server (*)Terraform Enterprise server connection.
Workspace attributes (*)Workspace attributes as JSON.
Tag bindingsKey-value tag bindings for workspace.

Output Properties

Create Workspace Output

FieldDescription
Workspace ID (*)Workspace ID.

Delete Workspace

This task deletes an existing workspace from the configured TFE organization. Use it to clean up workspaces that are no longer needed as part of your release workflow.

Input Properties

Delete Workspace Input

FieldDescription
TFE server (*)Terraform Enterprise server connection.
Workspace ID (*)Workspace ID.
Safe deleteRefuses deletion if workspace has managed resources.

Get Run

This task retrieves a Terraform run by its run ID. If no run ID is provided, the latest run for the workspace is returned.

Input Properties

Get Run Input

FieldDescription
TFE server (*)Terraform Enterprise server connection.
Workspace ID (*)Workspace ID.
Run IDRun ID to fetch. If omitted, the latest run for the workspace is returned.

Output Properties

Get Run Output

FieldDescription
Run ID (*)Run ID of the fetched run.
Run status (*)Current run status.
Has changesWhether the run detected infrastructure changes.
Plan summary (*)Plan details as JSON.
Apply summary (*)Apply details as JSON.
Cost estimation summary (*)Cost estimate details as JSON. Empty if cost estimation is not enabled.
Run details (*)Run details as JSON.

Get Workspace State

This task retrieves the current state of a workspace, including the state serial number, the resource count, and all Terraform outputs as a JSON string.

Input Properties

Get Workspace State Input

FieldDescription
TFE server (*)Terraform Enterprise server connection.
Workspace ID (*)Workspace ID.
State Version IDState Version ID to fetch. If omitted, the current state for the workspace is returned.

Output Properties

Get Workspace State Output

FieldDescription
State serial (*)State serial number.
Resource count (*)Total managed resource count.
State outputs (*)JSON object of Terraform output key-value pairs.