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

# 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.firefly.ai/integrations/iac-remote-state/terraform-cloud.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
