# Configure Kafka as a Snowbridge target
> Configure Kafka target for Snowplow Snowbridge to write data to Kafka topics with SASL authentication and TLS encryption.
> Source: https://docs.snowplow.io/docs/api-reference/snowbridge/configuration/targets/kafka/
> Documentation index: https://docs.snowplow.io/llms.txt

[Snowplow supported](/docs/destinations/#destinations-catalog "Built and supported by Snowplow") · Snowbridge target · Streaming

Where SASL is used, it may be enabled via the `enable_sasl`, `sasl_username`, and `sasl_password` and `sasl_algorithm` options.

we recommend using environment variables for sensitive values - which can be done via HCL's native `env.MY_ENV_VAR` format (as seen below).

TLS may be configured by providing the `key_file`, `cert_file` and `ca_file` options with paths to the relevant TLS files.

To compress data before sending it, set the `compression_type` option to `gzip`, `snappy`, `lz4`, or `zstd`. For the `gzip` and `zstd` codecs, you can also tune the compression level with the `compression_level` option. Compression reduces network usage but may add latency. The `zstd` codec requires Kafka version 2.1.0 or later, and `lz4` requires 0.10.0 or later.

> **Note: Added in version 6.1.0**
>
> These options replace the deprecated `compress` boolean option, which compresses with `snappy`. Setting `compress` still works but logs a warning. If both are set, `compression_type` takes precedence.

## Configuration options

Here is an example of the minimum required configuration:

```hcl
loading...
```

[View on GitHub](<&#xA;https://github.com/snowplow/snowbridge/blob/v6.3.0/assets/docs/configuration/targets/kafka-minimal-example.hcl&#xA;>)

If you want to use this as a [failure target](/docs/api-reference/snowbridge/concepts/failure-model/#failure-targets), then use failure\_target instead of target.

Here is an example of every configuration option:

```hcl
loading...
```

[View on GitHub](<&#xA;https://github.com/snowplow/snowbridge/blob/v6.3.0/assets/docs/configuration/targets/kafka-full-example.hcl&#xA;>)

If you want to use this as a [failure target](/docs/api-reference/snowbridge/concepts/failure-model/#failure-targets), then use failure\_target instead of target.
