HashiCorp Cloud Platform
Connect Infragraph to HCP Terraform
The HCP Terraform connection connects your HCP Terraform data to the resource graph.
Create an HCP Terraform team
We recommend you create a new HCP Terraform team to use for your Infragraph connection. To give Infragraph access to all workspaces in your HCP Terraform organization, give the team the following permissions:
- View all projects
- View all workspaces
You can use HCP Terraform permissions to limit the scope of your API token to specific projects or workspaces. Refer to the Manage teams documentation for more information.
Create an HCP Terraform team token
To connect Infragraph to HCP Terraform, you must provide an API token. Refer to the Team API Tokens documentation for more information.
Set up the connection
To establish a new HCP Terraform connection:
- From the Resource graph Overview, at the top right, click Create Connection.
- Select HCP Terraform from the list of data sources.
- Click Select Terraform.
- Enter your team token.
- Click the Create connection.
The data source connects to your HCP Terraform organization.
Sync HCP Terraform data
To find the current sync status for your connector, complete the following steps:
- Click Connections in your HCP organization's left navigation panel.
- Check the connection sync status.
Infragraph reports one of the following statuses:
- Awaiting initial sync means that the connection was created but Infragraph has not initiated the first data sync.
- Successful means there were no errors in the latest sync and Infragraph synced the data.
- Partial failure means at least one error occurred in the latest sync.
To manually initiate a new sync, select Sync connection from the … menu in the Actions column.
View HCP Terraform data
To find HCP Terraform data connected to your resource graph, try any of the following actions:
- Go to the Inventory page. Click an individual resource type to view it in the graph explorer.
- Query resources with a saved query that includes HCP Terraform resources.
- Build the query from scratch using HCP Terraform resources in the query editor. For easy filtering, you can select IaC or Management options.