Last update: 2025-05-07T10:44:34.000Z
Content:
---
title: "Connection files · Tinybird Docs"
theme-color: "#171612"
description: "Connection files describe your data connections. They're used by Tinybird connectors."
inkeep:version: "forward"
---




# Connection files (.connection) [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles/connection-files#connection-files-connection)

Copy as MD Connection files describe your data connections. They're used by Tinybird connectors to establish a connection when deploying to live environments. See [Connectors](/docs/forward/get-data-in/connectors).

Connection files bear the .connection extension and are stored in the connections folder of your project. See [Datafiles](/docs/forward/dev-reference/datafiles).

Connection files are not active in the local development environment. When using `tb dev` , connections to external services like Kafka or S3 will not be checked or ingest any data. Connections only become active after deploying to Local or Cloud environments.

## Structure [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles/connection-files#structure)

All .connection file contains a `TYPE` declaration that specifies the type of connection. For each connection type, a number of settings are mandatory.

The name of the .connection file determines the name used in .datasource files when defining the connection.

The following example shows a .connection file for a Kafka data source:

##### kafkasample.connection

TYPE kafka
KAFKA_BOOTSTRAP_SERVERS {{ tb_secret("PRODUCTION_KAFKA_SERVERS", "localhost:9092") }}
KAFKA_SECURITY_PROTOCOL SASL_SSL
KAFKA_SASL_MECHANISM PLAIN
KAFKA_KEY {{ tb_secret("PRODUCTION_KAFKA_USERNAME", "") }}
KAFKA_SECRET {{ tb_secret("PRODUCTION_KAFKA_PASSWORD", "") }} The calls to the `tb_secret` function contain the name of the secret and a default value. See [tb secret](/docs/forward/dev-reference/commands/tb-secret) to learn how to set and manage secrets.

Never add credentials as plain text in your datafiles. Use secrets instead.

## List your connections [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles/connection-files#list-your-connections)

To list your connections, run the [tb connections](/docs/forward/dev-reference/commands/tb-connection) command:

tb connection ls
## Update a connection [¶](https://www.tinybird.co/docs/forward/dev-reference/datafiles/connection-files#update-a-connection)

To update or refresh a connection after changing settings or secrets, redeploy your project. See [Deployments](/docs/forward/test-and-deploy/deployments) . Connections remain active using the previous settings until you deploy them again.


