Skip to main content

Terraform Plugin

Here we'll help you generate an access token for Terraform Cloud and configure the necessary settings to integrate Terraform Cloud with your developer platform.

Generating an Access Token for Terraform Cloud

Terraform supports multiple types of API tokens with varying levels of access:

  • User API tokens - Tokens that belong to a specific user that reflect the same permission level as your user account. User tokens are the only token type that can be granted access to multiple organizations.
  • Team API tokens - Tokens that belong to a specific team which are used by services, for example a CI/CD pipeline, to perform plans and applies on a workspace.
  • Organization API tokens - Tokens that belong to an organization that are used to manage teams, team membership, and workspaces. Organization tokens do not have permission to perform plans and applies in workspaces.
  • Audit API tokens - Tokens that provide read-only access for the audit trails API.

You can configure the Terraform plugin in Venue.sh using any token type.

  1. Navigate to the API tokens page in your Terraform Cloud account.

    tip

    Consider creating a dedicated automation/bot account at the user level for API usage.

  2. Once logged in to your account, create an API token of your choice.

  3. In the token-creation modal, enter a token description, like "Venue.sh," for easy identification later.

    note

    Terraform Cloud displays the API token only once! Copy and save it in a safe location, as you will not be able to view it again.

Configuring the Terraform Plugin in Venue.sh

  1. In the Venue.sh app, click Plugins in the left-side navigation.

  2. Find Terraform, then click Enable Plugin.

  3. Paste the Terraform token you created in the previous section into the Terraform Token field.

  4. Click Enable.

Component Setup

Within your component catalog-info.yaml file, add the following annotations to connect up your Terraform Cloud:

metadata:
annotations:
terraform/organization: YOUR_ORGANIZATION
terraform/workspaces: YOUR_WORKSPACE

You can add multiple workspaces by adding more workspaces to the terraform/workspaces annotation:

metadata:
annotations:
terraform/organization: YOUR_ORGANIZATION
terraform/workspaces: YOUR_WORKSPACE,YOUR_WORKSPACE_2,YOUR_WORKSPACE_3