Terraform Cloud Run Tasks

Terraform Cloud Overview

Terraform Cloud (TFC) is a SaaS paid platform provided by HashiCorp that provides production-ready state management with continuous delivery for its users. Teams managing their cloud infrastructure with Terraform benefit from:

  • Terraform Cloud remote state out-of-the-box management with built-in versioning

  • A centralized location for the team to collaborate on infrastructure, in order to review and approve changes.

Last year at HashiConf Europe, HashiCorp previewed a new feature called run tasks for HashiCorp Terraform Cloud. The run tasks feature enables organizations to integrate third-party tools within a Terraform run, specifically between the plan and apply stages of the Terraform Cloud workflow.

In April 2022, Firefly created the capability to scan the Terraform cloud footprint and automatically codify unmanaged and drifted assets. In addition, Firefly used the run task integration to anticipate how changes in the Terraform plan affect other assets in the environment, regardless of whether those assets are managed by Terraform.

If you are a Terraform Cloud user, sign up with Firefly to integrate and connect your workspaces in Terraform Cloud. Anticipating changes before deployment avoids costly mistakes in your software development lifecycle with Terraform Cloud.

Note: This feature is only available for HashiCorp Business tier users.

Integrating Terraform Cloud with Firefly

Before you begin

You must be the administrator of your Firefly account to configure the Terraform Cloud integration.

Procedure

  1. Go to the left pane > Settings > Integrations.

  2. Select Add New > Terraform Cloud.

  3. Go here, to create an API token. Copy the token.

  4. In Firefly, select a Nickname, and paste the API token.

  5. Select Next.

  6. Copy the Endpoint URL and HMAC key created by Firefly.

  7. Go here, to paste the Endpoint URL and HMAC key.

  8. In the Terraform Console, select Create a run task.

  9. From the Workspaces tab, select Settings > Run Tasks. The newly created run task appears in the Run Task window.

  10. Select the add icon to add the run task to your workspace.

  11. Select the Enforcement Level of the run task. (Only the Advisory level is supported by Firefly):

    1. Advisory (Informs the user of a failure without interrupting the run).

    2. Mandatory (The run is terminated, and applied when the failure is resolved).

  12. To start a new run, select Actions > Start new run.

Viewing integration results

  • After the run tasks is completed, you can view the results and the number of assets affected by Firefly integration in Tasks Passed.

  • Select Details to go to Firefly’s Inventory table, which displays asset configuration and IaC status.

Last updated