CloudQuery News

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:

  1. 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.
  2. Install CloudQuery CLI
    If you haven’t already, download and install the CloudQuery CLI from our download page.
  3. Set Up the Sync Configuration
    Create a CloudQuery configuration file by running:
cloudquery init --source terraform-cloud --destination postgresql

This command will create a terraform-cloud_to_postgresql.yaml file in your current directory.

  1. Set The Environment Variables
    • Set ${TERRAFORM_CLOUD_TOKEN} as an environment variable with export TERRAFORM_CLOUD_TOKEN='YOUR_TERRAFORM_CLOUD_TOKEN
    • Set ${POSTGRESQL_CONNECTION_STRING} as an environment variable with export POSTGRESQL_CONNECTION_STRING='YOUR_POSTGRESQL_CONNECTION_STRING
  2. Sync With CloudQuery
    Log in with:
cloudquery login

Then run:

cloudquery sync terraform-cloud_to_postgresql.yaml

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:

SELECT
name,
two_factor_conformant
FROM
tfcloud_organizations
WHERE
two_factor_conformant != 'f';

Show workspaces in Terraform with failed policy checks

SELECT name, policy_check_failures
FROM tfcloud_workspaces
WHERE policy_check_failures > 0;

List all organizations in Terraform with workspaces that have failed runs and show the total number of failures per organization

SELECT
o.name AS organization_name,
COUNT(w.id) AS workspace_count,
SUM(w.run_failures) AS total_run_failures
FROM
tfcloud_organizations o
JOIN
tfcloud_workspaces w
ON
o.name = w.organization->>'Name'
WHERE
w.run_failures > 0
GROUP BY
o.name
ORDER BY
total_run_failures DESC;

Cost Management

Find Terraform workspaces with high costs

SELECT
name,
cost_estimate
FROM
tfcloud_workspaces;

List all Terraform organizations with cost estimation disabled

SELECT
name
FROM
tfcloud_organizations
WHERE
cost_estimation_enabled = 'f';

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.

Related posts

CloudQuery News

Introducing CloudQuery Insights: Cloud Intelligence That Connects the Dots

CloudQuery Insights automatically surfaces connected signals across your cloud inventory: security findings, cost data, policy violations, and audit trails.

Joe Karlsson

Joe Karlsson

April 21, 2026

Cloud Infrastructure

CloudQuery News

Introducing the Nautobot Source Integration

Sync Nautobot DCIM inventory data to PostgreSQL, BigQuery, or Snowflake and query it with SQL alongside your cloud provider data.

Joe Karlsson

Joe Karlsson

March 19, 2026

CloudQuery News

CloudQuery Is Merging with Env Zero

A letter from CloudQuery CEO Yevgeny Pats on the merger with env zero and what it means for customers.

Yevgeny Pats

Yevgeny Pats

March 17, 2026

CloudQuery News

Security

Introducing the Zoom Source Integration

New CloudQuery Zoom source plugin: sync Zoom meeting, user, and webinar data into your database for compliance, analytics, and user access governance reporting.

Joe Karlsson

Joe Karlsson

February 2, 2026

CloudQuery News

Product News

New in CloudQuery: Tines + Semgrep integration, and native visualizations,

CloudQuery October 2025 updates: Tines and Semgrep integration for security orchestration, plus native visualization support in the CloudQuery Platform.

Chris Reuter

Chris Reuter

October 31, 2025

CloudQuery News

Product News

Security

Introducing Data Access Control for CloudQuery Platform

CloudQuery Platform RBAC: Control cloud asset access with SQL-based permissions. Map Azure AD/Okta groups to roles. Available now on all environments.

Joe Karlsson

Joe Karlsson

October 28, 2025

AI

CloudQuery News

Understand your cloud infra faster using natural language

CloudQuery unifies AWS, GCP, Azure, and SaaS configs into SQL tables. The new AI assistant lets you query your cloud inventory using natural language.

Chris Reuter

Chris Reuter

September 29, 2025

CloudQuery News

Find the Cloud Waste Contest

Win CloudQuery swag by finding cloud waste in our dataset. Sync AWS data with CloudQuery, solve 3 SQL challenges, get t-shirts, sweatshirts, and mugs.

Joe Karlsson

Joe Karlsson

September 25, 2025

AI

CloudQuery News

Generate CloudQuery Configuration with Natural Language

Generate CloudQuery config files from natural language prompts. Use AI to quickly create source and destination plugin configs without manual YAML editing.

Chris Reuter

Chris Reuter

September 23, 2025

Own your pipeline.
Own your data.