Skip to main content

Listeners and Rules

When you create a Connector, you define listeners that specify how clients connect to it.

Listeners

A listener monitors a specific port for incoming client connections. You can define multiple listeners on different ports for different use cases.
Port 8080 is reserved for the Connector’s health check endpoint and cannot be used for listeners.

Listener Rules

Each listener uses routing rules to determine where to forward requests. There are two rule types:
Routes all connections to a specific resource.Example: All traffic on port 5432 goes to the production-postgres database.
Routes connections to all resources of a specific technology (e.g., all PostgreSQL databases). When multiple resources match, smart routing automatically selects the correct resource based on the connection string. Spaces limit which resources are accessible.
A single listener can have multiple rules, and you can combine different rule types.

Terraform Example

The following example demonstrates how to deploy a Connector linked to all PostgreSQL resources:
This configuration creates:
  • A Connector named main
  • A listener on port 5432, attached to the Connector through connector_id
  • A technology rule that routes all PostgreSQL traffic to any PostgreSQL resource in your organization
Always set connector_id on formal_connector_listener. A listener without it is not attached to any Connector.