# Terraform Cloud

Firefly integrates with Terraform Cloud and Terraform Enterprise to pull in workspaces tfstate files. This integration allows Firefly to analyze your Terraform state files, providing comprehensive visibility into your infrastructure resources managed through Terraform Cloud or Enterprise.

## Prerequisites

* A Terraform Cloud or Terraform Enterprise account.
* An API token with read permissions on the organization.

## Integrate Terraform Cloud

This procedure allows Firefly to access your Terraform Cloud IaC stacks.

### Setup Procedure

1. Log in to your Terraform Cloud account.
2. Create an API token.
3. Copy the token.
4. In Firefly, click **Settings > Integrations**.
5. Click **Add New > Terraform Cloud**.
6. Enter a descriptive name into the **Nickname** field.
7. Paste the token into the **API token** field.
8. Click **Next**.
9. Click **Done**.

## Integrate Terraform Enterprise

This procedure allows Firefly to access your Terraform Enterprise IaC stacks.

Terraform Enterprise is a self-hosted version of Terraform Cloud used either on-premises or in your public cloud.

### Setup Procedure

1. Log in to your Terraform Enterprise account.
2. Create an API token.
3. Copy the token.
4. In Firefly, click **Settings > Integrations**.
5. Click **Add New > Terraform Cloud**.
6. Enter a descriptive name into the **Nickname** field.
7. Paste the token into the **API token** field.
8. Enter the domain name of your Terraform Enterprise environment in the **Terraform Enterprise** field.
9. Allow external access to the following IPs:
   * 3.224.145.192
   * 54.83.245.177
   * 3.213.167.195
   * 54.146.252.237
   * 34.226.97.113
   * 54.166.221.160
   * 52.22.128.83
   * 52.86.171.233
   * 34.200.154.87
   * 100.25.162.125
   * 18.209.82.232
   * 98.83.246.85
   * 54.144.58.153
10. Click **Next**.
11. Click **Done**.

## Configuration Details

* Firefly scans your workspaces tfstate files by default every 4 hours.
* Your Terraform Cloud workspaces state files list will stay updated automatically.
