---
title: "Terraform"
slug: "terraform"
updated: 2024-05-30T11:52:12Z
published: 2024-05-30T11:52:12Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.safe.security/llms.txt
> Use this file to discover all available pages before exploring further.

# Terraform

## **About this document**

---

This document provides the step-by-step procedure to configure Terraform in SAFE.

## **Introduction**

---

SAFE integrates with Terraform and fetches the security misconfiguration of the Terraform account in SAFE.

## **Prerequisites**

---

- Access required in **SAFE**:
  - SAFE Admin Access
- Access required in **Terraform**:
  - Terraform Admin
- Required User Inputs:
  - API URL
  - Access Token
  - Organization ID
- Required Scope:
  - Admin Access

## **Generate Connection Details**

---

- How to generate an **Access Token**
  - Log in to your Terraform account as **Admin**.
  - Click on the **Settings**option from the left panel

![](https://cdn.document360.io/23dc20b8-a989-48c0-8653-f1d3e4abc734/Images/Documentation/1(42).png)
  - Click on the **API Tokens**under the **Security**Section
  - Click on the **Create an organization token** button

![](https://cdn.document360.io/23dc20b8-a989-48c0-8653-f1d3e4abc734/Images/Documentation/2(40).png)
  - Select the **Expiration**date
  - Click on the **Generate token** button

![](https://cdn.document360.io/23dc20b8-a989-48c0-8653-f1d3e4abc734/Images/Documentation/3(38).png)
  - The system displays the **Access Token**. Copy and save the Access Token to use it while configuring Terraform in SAFE.
  - It's important to regularly update the Access Token in SAFE according to its expiration date.

![](https://cdn.document360.io/23dc20b8-a989-48c0-8653-f1d3e4abc734/Images/Documentation/4(38).png)
- How to get an **Organization ID**
  - Log in to your Terraform account as **Admin**.
  - Click on the **Settings**option from the left panel

![](https://cdn.document360.io/23dc20b8-a989-48c0-8653-f1d3e4abc734/Images/Documentation/5(38).png)
  - Click on the **General** under **Organization Settings**Section
  - The system displays the **Name**. Copy and save the Name to use it while configuring Terraform in SAFE.
- How to get **API URL**
  - Access the Terraform API documentation by clicking on the provided [link](https://developer.hashicorp.com/terraform/enterprise/api-docs/account).
  - Upon reaching the Terraform API documentation page, locate the section titled as "**Get your account details**".
  - In the exhibit provided, find the base URL highlighted as 3. **Copy** and **save** this *API Base URL* to use it while configuring Terraform in SAFE.

![](https://cdn.document360.io/23dc20b8-a989-48c0-8653-f1d3e4abc734/Images/Documentation/6(37).png)

## **Configure Terraform in SAFE**

---

- Log in to your SAFE account as **Admin**.
- Click on the **Integrations**option from the left navigation.
- Scroll to find the Terraform integration card or search for Terraform in the search bar.

![](https://cdn.document360.io/23dc20b8-a989-48c0-8653-f1d3e4abc734/Images/Documentation/7(37).png)
- Hover over the Terraform integration card and click on the **Configure** button.
- Enter the following:
  - API URL
  - Access Token
  - Organization ID
- Enter the **Auto Sync Frequency**.

![](https://cdn.document360.io/23dc20b8-a989-48c0-8653-f1d3e4abc734/Images/Documentation/8(40).png)
- Click on the **Test Connection** button.
- Once the connection is successful, click on the **Save** button.
- Once the configuration is saved successfully, click on the **Sync** **Now** button to trigger an on-demand sync.

![](https://cdn.document360.io/23dc20b8-a989-48c0-8653-f1d3e4abc734/Images/Documentation/9(38).png)
- Upon a successful sync, the system pulls the Terraform assets and their findings in SAFE. You can track the status of the sync in the **History** table.

## **View Results**

---

- Go to the**Integration**homepage.
- Scroll to find the Terraform integration card or search for Terraform in the search bar.
- Click on the Terraform integration card for **Finding View** and **Asset View**.
  - **Finding View:** This tab displays all the findings details pulled from Terraform.

![](https://cdn.document360.io/23dc20b8-a989-48c0-8653-f1d3e4abc734/Images/Documentation/10(31).png)
  - **Asset View:**This tab displays all the assets pulled from Terraform.

![](https://cdn.document360.io/23dc20b8-a989-48c0-8653-f1d3e4abc734/Images/Documentation/11(22).png)

## **History**

---

Learn More about Integration History [here](https://docs.safe.security/safe-4/docs/integration-history).

## **SAFE's Outgoing IP Addresses**

---

Click [here](https://docs.safe.security/safe-4/docs/safes-outgoing-ip-addresses) to find the outgoing IP addresses of SAFE. All traffic to any integrations in SAFE will see one IP address as the source IP of the incoming connection.

<input spellcheck="false" tabindex="0" class="labels__input" style="font:inherit;width:153.333px;color:inherit;background:0px center;opacity:1;grid-area:1 / 2;min-width:2px;border:0px;margin:0px;outline:0px;padding:0px;" id="react-select-10-input" type="text" value="" autocomplete="off" data-display="block">
