# Manage Connections using Rudder CLI


{{< announcement >}}
This feature is in **Public Beta** as part of RudderStack's Early Access Program, where we work with early users and customers to test new features and get feedback before making them generally available.

[Contact the Product team](mailto:product@rudderstack.com) if you have any questions.
{{< /announcement >}}

A **connection** is the link between an Event Stream source and a destination. Rudder CLI already manages Event Stream sources and destinations as YAML. Connection specs declare those links in the same project so `rudder-cli apply` creates the source, destination, and connection in the right order — without a dashboard step to wire them together.

Use `kind: event-stream-connections`. Each entry in `spec.connections` references resources in the **same project** (`#event-stream-source:…` and `#destination:…`). Rudder CLI uses those references to create endpoints before the connection, and to delete the connection before the endpoints.

Reverse ETL connections (SQL model to destination) are not supported yet.

{{< warning >}}
**Connection support is experimental**.

Enable the `connectionSupport` flag in your CLI configuration (or set `RUDDERSTACK_X_CONNECTION_SUPPORT=true`) before you validate or apply connection resources. Destination specs in the same project still need `destinationSupport`.
{{< /warning >}}

## Key features

### Declarative links

- Declare many connections in one YAML file. Each entry has a local `id` plus `source` and `destination` URNs.
- Set `enabled` to control whether that pair delivers. If you omit `enabled`, it defaults to `true`. Both endpoints must also be enabled for data to flow.
- Delete a connection spec to disconnect the pair without deleting the source or destination.

### Local validation

`rudder-cli validate` checks Event Stream connection specs — including that both endpoints exist in the project, the pair is unique, and the destination definition supports the source type.

See [Connection YAML Reference]({{< ref "dev-tools/rudder-cli/yaml-connections.md#validation-rules" >}}) for the full rule list.

### Git integration and CI/CD support

- Import Event Stream connections from your workspace, then manage them in Git.
- Run `validate` in CI so a pull request that violates connection rules fails before apply.

## Who can use this feature?

CLI-based connections are useful when you need to:

- Keep source, destination, and the link between them in one repository.
- Catch incompatible source–destination pairs in CI instead of after apply.

## Limits

- **Reverse ETL connections** — SQL model to destination links are not supported yet.
- **Cloud Extract connections** — Rudder CLI does not manage Cloud Extract sources yet.

## Apply and replace behavior

- Changing `source` or `destination` on an existing connection is a **replacement** (delete + create), not an in-place update. The backend treats each source–destination pair as unique.
- `enabled` is the only field you can update in place.

## Validation limitation

Topology rules inspect **project-managed** connections only. A connection that exists in the workspace but is not in the project is invisible at validate time. Where the API also enforces the rule, apply still fails. Where it does not, the conflict appears only in the workspace.

## Get started

- Follow the [End-to-End Walkthrough: Connections with Rudder CLI]({{< ref "dev-tools/rudder-cli/connections-walkthrough.md" >}}) to link an Event Stream source and a destination
- See the [Connection YAML Reference]({{< ref "dev-tools/rudder-cli/yaml-connections.md" >}}) for fields and validation rules
- Define endpoints first: [Event Stream sources]({{< ref "dev-tools/rudder-cli/event-stream-sources.md" >}}) and [destinations]({{< ref "dev-tools/rudder-cli/destinations.md" >}})
- Automate with [GitHub Actions for Rudder CLI]({{< ref "dev-tools/rudder-cli/github-actions" >}})

