Connections
Connections are sets of credentials that enable Bruin to communicate with external platforms. They are configured within your project's .bruin.yml file.
Overview
Bruin supports connections to:
- Data Platforms: Where your data is stored and transformed (BigQuery, Snowflake, PostgreSQL, etc.)
- Ingestion Sources: Where data is loaded from (Shopify, HubSpot, Stripe, etc.)
Connection Structure
Connections are defined within an environment under the connections key, grouped by connection type:
environments:
default:
connections:
# Data platform connection
google_cloud_platform:
- name: "gcp-prod"
project_id: "my-project"
service_account_file: "credentials/gcp-service-account.json"
# Database connection
postgres:
- name: "postgres-main"
username: "bruin_user"
password: "super_secret"
host: "db.example.com"
port: 5432
database: "analytics"
# Ingestion source connection
shopify:
- name: "shopify-default"
api_key: "shpca_abc123"
store_name: "my-store"NOTE
You can reference environment variables in connection fields using ${VAR_NAME} placeholders, which are expanded at runtime.
Connection Names
Each connection has a unique name that you reference in your pipeline and asset definitions:
# pipeline.yml
default_connections:
google_cloud_platform: "gcp-prod"
postgres: "postgres-main"# asset.yml
name: raw.orders
type: ingestr
parameters:
source_connection: shopify-default
destination: postgresDefault Connections
Pipelines can define default connections that are automatically used by assets of that type:
# pipeline.yml
name: analytics-daily
default_connections:
google_cloud_platform: "gcp-prod"
snowflake: "sf-default"
postgres: "pg-default"Assets automatically inherit these connections unless they specify a different one.
Data Platform Connections
For specific connection fields and configuration options, see the dedicated documentation:
| Connection Type | Documentation |
|---|---|
google_cloud_platform | Google BigQuery |
snowflake | Snowflake |
postgres | PostgreSQL |
redshift | Redshift |
databricks | Databricks |
athena | AWS Athena |
duckdb | DuckDB |
motherduck | MotherDuck |
clickhouse | ClickHouse |
mysql | MySQL |
mssql | Microsoft SQL Server |
synapse | Azure Synapse |
oracle | Oracle |
trino | Trino |
s3 | S3 |
Ingestion Source Connections
Connection schemas for ingestion sources are documented on their respective pages under Data Ingestion. Each source page includes the required .bruin.yml connection configuration.
Testing Connections
Use the connections command to verify your connections:
# List all connections
bruin connections list
# Test a specific connection
bruin connections ping gcp-prodRelated Topics
- Project - Configure your project and environments
- Secrets - Manage custom credentials
- .bruin.yml Reference - Complete configuration reference