Introducing the New Terraform Cloud Source Integration for CloudQuery
Terraform Cloud is a hosted service for Terraform, an open-source tool that helps teams set up and manage infrastructure using code (IaC). It provides a central platform for automating deployments and makes it easier for teams to work together on infrastructure changes. With features like state management, running tasks remotely, and integrations with tools like GitHub, it simplifies the process of keeping infrastructure up to date.
Today, we're excited to announce the release of the CloudQuery Terraform Cloud Source Integration. This integration lets you extract valuable information from your Terraform Cloud setup and load it into any supported CloudQuery destination. It enables powerful SQL-based querying and analysis of your infrastructure management data.
What Can You Do with the Terraform Cloud Integration?
Our Terraform Cloud Integration integrates directly with the Terraform Cloud API to retrieve data from your organizations, projects, teams, and workspaces. This integration enables you to analyze and manage Terraform resources using SQL queries.
With this release of the CloudQuery Terraform Cloud Source Integration, you can sync and query data about your:
Getting Started with the CloudQuery Terraform Cloud Integration
To start using the Terraform Cloud integration, you'll need to:
- Get Your API Token
First, generate a Terraform API token in your Terraform Cloud user settings. You’ll need this token to authenticate with the Terraform Cloud API. - Install CloudQuery CLI
If you haven’t already, download and install the CloudQuery CLI from our download page. - Set Up the Sync Configuration
Create a CloudQuery configuration file by running:
This command will create a terraform-cloud_to_postgresql.yaml file in your current directory.
- Set The Environment Variables
• Set ${TERRAFORM_CLOUD_TOKEN} as an environment variable withexport TERRAFORM_CLOUD_TOKEN='YOUR_TERRAFORM_CLOUD_TOKEN
• Set ${POSTGRESQL_CONNECTION_STRING} as an environment variable withexport POSTGRESQL_CONNECTION_STRING='YOUR_POSTGRESQL_CONNECTION_STRING - Sync With CloudQuery
Log in with:
Then run:
For more details, check out the Terraform Cloud Source Integration documentation.
Use cases
Security and Compliance
List all organizations in Terraform that have two-factor authentication enabled:
Show workspaces in Terraform with failed policy checks
List all organizations in Terraform with workspaces that have failed runs and show the total number of failures per organization
Cost Management
Find Terraform workspaces with high costs
List all Terraform organizations with cost estimation disabled
Ready to learn more about your Terraform Cloud Infrastructure? Try CloudQuery locally with our quick start guide. Got feedback or suggestions?: Join the CloudQuery Community to connect with other users and experts.
Try CloudQuery yourself
Self-hosted, open source, and free to start. Or schedule a demo to see the managed version.



