Skip to content
GitLab

Managing Connections

Connections are the bridge between the Akili platform and external data systems. Every kind: source input port in inputs.yaml references a named connection. This guide covers creating, testing, and managing connections for all supported connector types.

Connector TypeUse CaseProtocol
postgresRelational databases (CDC and incremental)PostgreSQL wire protocol
mysqlRelational databases (CDC and incremental)MySQL protocol
s3Object storage (file ingestion)S3-compatible API
redpanda / kafkaEvent streamsKafka protocol
httpREST APIsHTTP/HTTPS

Connections are registered via the CLI with a JSON configuration object. The configuration fields vary by connector type.

Terminal window
akili connection create \
--name production-db \
--connector-type postgres \
--config '{
"host": "db.example.com",
"port": 5432,
"database": "orders",
"username": "akili_reader",
"ssl_mode": "require"
}'
Terminal window
akili connection create \
--name data-lake-input \
--connector-type s3 \
--config '{
"endpoint": "https://s3.example.com",
"bucket": "raw-data",
"prefix": "orders/",
"region": "us-east-1",
"path_style": true
}'
Terminal window
akili connection create \
--name event-stream \
--connector-type redpanda \
--config '{
"brokers": ["broker-1:9092", "broker-2:9092"],
"security_protocol": "SASL_SSL",
"sasl_mechanism": "SCRAM-SHA-256"
}'
Terminal window
akili connection create \
--name weather-api \
--connector-type http \
--config '{
"base_url": "https://api.weather.example.com/v2",
"auth_type": "bearer",
"timeout_seconds": 30,
"rate_limit_rps": 10
}'

Always test a connection after creation to verify connectivity and credentials:

Terminal window
# Test by connection ID
akili connection test conn-abc123
# Output on success:
# OK Connection 'production-db' is reachable
# Output on failure:
# FAIL Connection 'production-db': timeout after 30s

The test performs a lightweight probe appropriate to the connector type:

Connector TypeTest Method
postgres / mysqlSELECT 1 query
s3HeadBucket API call
redpanda / kafkaMetadata request to broker
httpHEAD request to base URL

After a connection is established, use the discover command to see available resources (tables, topics, paths):

Terminal window
# Discover tables in a PostgreSQL connection
akili connection discover production-db
# Output:
# RESOURCE TYPE ROWS
# public.orders table 1,284,302
# public.customers table 45,891
# public.products table 3,204
# public.regions view 48

Drill into a specific resource to see its column schema:

Terminal window
akili connection schema production-db public.orders
# Output:
# COLUMN TYPE NULLABLE
# order_id uuid NO
# customer_id uuid NO
# product_id uuid NO
# quantity integer NO
# unit_price decimal(10,2) NO
# total_amount decimal(12,2) NO
# region text YES
# order_date date NO
# created_at timestamptz NO

This schema information can be used to populate the columns field in inputs.yaml.

Terminal window
# List all connections for the current tenant
akili connection list
# As JSON
akili connection list --json

Update connection parameters without recreating the connection:

Terminal window
akili connection update \
--id conn-abc123 \
--config '{
"host": "new-db.example.com",
"port": 5432,
"database": "orders",
"username": "akili_reader",
"ssl_mode": "require"
}'
Terminal window
# Attempt deletion (requires --confirm)
akili connection delete conn-abc123 --confirm

Deletion will fail if any deployed data product references the connection in its inputs.yaml. You must first undeploy or update those products to remove the dependency.

Once created, connections are referenced by name in inputs.yaml:

inputs:
- name: orders
kind: source
connection: production-db # <-- connection name
resource: public.orders
strategy: cdc
cursor_field: updated_at

The platform resolves the connection name to the full connection configuration (including credentials from Kubernetes secrets) at execution time. Manifests never contain connection details directly.

%%{init: {'flowchart': {'curve': 'basis'}}}%%
flowchart LR
    A[Create connection] --> B[Test connectivity]
    B --> C[Discover resources]
    C --> D[Reference in inputs.yaml]
    D --> E[Deploy product]
    E --> F[Connection used at runtime]
    F --> G[Rotate credentials]
    G --> B

When credentials need rotation:

  1. Update the Kubernetes secret with new credentials
  2. Test the connection: akili connection test <id>
  3. No product redeployment is needed — credentials are resolved at runtime