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

# Terraform

> Follow these steps to connect Terraform via the StackOne Hub successfully.

<Warning>
  Ensure you have Admin or Owner privileges within your Terraform account.
</Warning>

If you've been directed to StackOne to integrate with Terraform, the following steps will help you understand the process and any necessary actions to configure successful integration.

## Get Your Terraform Organization Name

<Steps>
  <Step title="Find Organization Name">
    Each connected Account with StackOne will be associated with one Terraform Organization.

    While logged in to your [Terraform](https://app.terraform.io) instance, your Organization Name is visible in the top left corner before the current Workspace.

    Your Organization Name also exists in the URL. Example: `https://app.terraform.io/app/{{Organization Name}}/workspaces`

    <Frame>
      <img className="rounded-md" style={{ margin: '0 auto', border: '1px solid #efefef' }} alt="Organization Name" src="https://mintcdn.com/stackone-hub/sJdRVJBL-SmQlUk2/images/terraform/image1.png?fit=max&auto=format&n=sJdRVJBL-SmQlUk2&q=85&s=634783ec11ac90bacdf7bea0b9c30962" width="695" height="438" data-path="images/terraform/image1.png" />
    </Frame>
  </Step>
</Steps>

## Get Your Terraform API Token

<Steps>
  <Step title="Open Account Settings">
    Click your profile icon in the top left, then click [Account settings](https://app.terraform.io).

    <Frame>
      <img className="rounded-md" style={{ margin: '0 auto', border: '1px solid #efefef' }} alt="Account Settings" src="https://mintcdn.com/stackone-hub/sJdRVJBL-SmQlUk2/images/terraform/image2.png?fit=max&auto=format&n=sJdRVJBL-SmQlUk2&q=85&s=5f0d6bed305247d0f7426bdba3db9b08" width="644" height="623" data-path="images/terraform/image2.png" />
    </Frame>
  </Step>

  <Step title="Navigate to Tokens">
    Click Account settings > Tokens on the left.

    <Frame>
      <img className="rounded-md" style={{ margin: '0 auto', border: '1px solid #efefef' }} alt="Tokens" src="https://mintcdn.com/stackone-hub/iZWSHb259O17akRl/images/terraform/image3.png?fit=max&auto=format&n=iZWSHb259O17akRl&q=85&s=07bc84d0606d878b3e7349b595145901" width="367" height="394" data-path="images/terraform/image3.png" />
    </Frame>
  </Step>

  <Step title="Create API Token">
    Under Tokens, click the Create an API token button.

    <Frame>
      <img className="rounded-md" style={{ margin: '0 auto', border: '1px solid #efefef' }} alt="Create API Token" src="https://mintcdn.com/stackone-hub/iZWSHb259O17akRl/images/terraform/image4.png?fit=max&auto=format&n=iZWSHb259O17akRl&q=85&s=d03b3630447eb5d7a6d1e653dacdcd4e" width="878" height="408" data-path="images/terraform/image4.png" />
    </Frame>
  </Step>

  <Step title="Enter Token Details">
    Under Creating a user token, enter a Description and your desired Expiration, then click the Generate token button.

    <Frame>
      <img className="rounded-md" style={{ margin: '0 auto', border: '1px solid #efefef' }} alt="Token Details" src="https://mintcdn.com/stackone-hub/iZWSHb259O17akRl/images/terraform/image5.png?fit=max&auto=format&n=iZWSHb259O17akRl&q=85&s=14c56c554ad506fd64e5220c279d9320" width="642" height="430" data-path="images/terraform/image5.png" />
    </Frame>
  </Step>

  <Step title="Copy API Token">
    Copy your displayed Token and store it safely.

    <Frame>
      <img className="rounded-md" style={{ margin: '0 auto', border: '1px solid #efefef' }} alt="Copy API Token" src="https://mintcdn.com/stackone-hub/iZWSHb259O17akRl/images/terraform/image6.png?fit=max&auto=format&n=iZWSHb259O17akRl&q=85&s=b75f5bb8be55b8e386fed1af9c23adc7" width="1571" height="662" data-path="images/terraform/image6.png" />
    </Frame>
  </Step>
</Steps>

## Connecting with StackOne

<Steps>
  <Step title="Enter API Token and Organization Name">
    Upon reaching the Link Account page, enter your API Token and Organization Name from the previous steps.
  </Step>

  <Step title="Connect">
    Proceed by clicking the Connect button.
  </Step>
</Steps>

## Available data

This integration has the following [IAM Resources](https://docs.stackone.com/reference/iam_list_users) available from the provider:

<ul>
  <li>Users</li>
  <li>Roles</li>
  <li>Groups</li>
  <li>Policies</li>
</ul>

## Useful Links

<Card title="API Reference" icon="link" href="https://developer.hashicorp.com/terraform/cloud-docs/api-docs">
  [https://developer.hashicorp.com/terraform/cloud-docs/api-docs](https://developer.hashicorp.com/terraform/cloud-docs/api-docs)
</Card>
