> For the complete documentation index, see [llms.txt](https://docs.gomboc.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gomboc.ai/integrations/cloud-orchestration/hcp-terraform.md).

# HCP Terraform

## Terraform Run Task Integration

Gomboc AI for Infrastructure as Code automatically fixes misconfigurations in your Terraform code. Gomboc translates cloud policies into production-ready IaC fixes delivered as pull requests, so you can merge confidently and keep pipelines moving without disruption.

## Integration Setup

Follow these steps to configure the Terraform Run Task integration:

### Step 1: Access Gomboc Portal

Navigate to **Settings > Integrations > HashiCorp** in the Gomboc Portal.

<div align="center"><figure><img src="/files/FSFm8ZjoWr7x9bjJeaVL" alt="Gomboc Integrations page showing HashiCorp section"><figcaption></figcaption></figure></div>

### Step 2: Create Integration

Enter a name to identify this integration and click **Integrate** to generate credentials.

<div align="center"><figure><img src="/files/xtIpeQZtRxVCSK9QYqGJ" alt="Integration creation form"><figcaption></figcaption></figure></div>

### Step 3: Collect Credentials

Copy the **HMAC Key** and **Webhook URL** - you’ll need these to configure the Run Task in Terraform Cloud.

<div align="center"><figure><img src="/files/OyfgwFIxA5ARQhsrhchX" alt="Integration credentials display"><figcaption></figcaption></figure></div>

### Step 4: Access HCP Organization

Now that your Gomboc-side integration is ready, let’s switch over to Terraform Cloud to finish setup. In a new tab, go to <https://app.terraform.io/> and select the organization where you want to enable this integration.

<div align="center"><figure><img src="/files/QpfIZRkSHL2WFumnz7XE" alt="HCP organization selection"><figcaption></figcaption></figure></div>

### Step 5: Navigate to Run Tasks

Go to **Settings > Integrations > Run tasks** and click **"Create run task"**.

<div align="center"><figure><img src="/files/KD0NGFNj5ps8RcItM8OO" alt="HCP Run Tasks page with create button"><figcaption></figcaption></figure></div>

### Step 6: Configure Run Task

Paste the Webhook URL and HMAC Key from Step 3 into the respective fields and add a display name.

<div align="center"><figure><img src="/files/aiXzNhBvo6F8P3o4iN6Q" alt="Run task configuration form"><figcaption></figcaption></figure></div>

### Step 7: Set Scope and Create

Configure the scope for your Run Task and click **Create**.

<div align="center"><figure><img src="/files/FIoupFR7ZYCRSkew4V8m" alt="Run task scope configuration"><figcaption></figcaption></figure></div>

## Configuration Options

### Scope Selection

When setting the scope for your Run Task, you can choose any scope that fits your workflow needs.

**Recommendation:** Select any option **except** "post-apply" to ensure Gomboc can remediate issues before changes are applied to your infrastructure.

### Enforcement Levels

You'll be prompted to select an enforcement level:

* **Advisory:** Shows warnings for detected misconfigurations but **does not block** the Terraform run from proceeding
* **Mandatory:** Shows errors for detected misconfigurations and **blocks** the Terraform run until issues are resolved

Choose the enforcement level that best matches your organization's policy for infrastructure changes.

### Deployment Options

You can configure Run Tasks at two levels:

#### Organization-Level Run Tasks

* Apply to all workspaces within the selected organization
* Ensures consistent policy enforcement across your infrastructure
* Recommended for most organizations

#### Workspace-Level Run Tasks

* Provide more granular control for specific teams or projects
* To configure: Skip the global setup in Step 7, then navigate to the desired workspace in HCP Terraform
* Go to **Settings > Run Tasks** and add the Gomboc Run Task you created

Choose the configuration approach that best fits your workflow and organizational requirements.

***

**Need help?** Leave feedback via our [GitHub discussions channel.](https://github.com/Gomboc-AI/gomboc-ai-feedback/discussions/6)
