<a id="cloud-ksql-connector-management"></a>

# Manage Connectors With ksqlDB on Confluent Cloud

Confluent Cloud ksqlDB supports ksqlDB [connector management](/platform/current/ksqldb/concepts/connectors.html).
This means you can create, inspect, and delete connectors in Confluent Cloud from your Confluent Cloud ksqlDB cluster.

## Confluent Cloud Console

You can issue ksqlDB connector management statements from the ksqlDB editor tab of the
Confluent Cloud Console with no extra setup steps required. You are prompted to confirm
pricing for any `CREATE CONNECTOR` statements before submitting them.

## ksqlDB Command Line Interface (CLI)

To issue connector management statements to your Confluent Cloud ksqlDB cluster from
the [ksqlDB CLI](/platform/current/ksqldb/operate-and-deploy/installation/cli-config.html),
pass a [Confluent Cloud API key](../security/authenticate/workload-identities/service-accounts/api-keys/manage-api-keys.md#cloud-cloud-api-keys) when launching the ksqlDB CLI:

```bash
ksql -u <KSQL_API_KEY> -p <KSQL_API_KEY_SECRET> --confluent-api-key <CONFLUENT_CLOUD_API_KEY> --confluent-api-secret <CONFLUENT_CLOUD_API_KEY_SECRET> <CONFLUENT_CLOUD_KSQLDB_SERVER_ADDRESS>
```

You can then issue ksqlDB connector management statements from the ksqlDB CLI the
same as any other ksqlDB statements.

You won’t be prompted to acknowledge pricing for any `CREATE CONNECTOR` statements
issued even though the usual connector pricing still applies.

## ksqlDB REST API

To issue connector management statements to your Confluent Cloud ksqlDB cluster using
the [ksqlDB REST API](/platform/current/ksqldb/developer-guide/ksqldb-rest-api/index.html),
pass a [Confluent Cloud API key](../security/authenticate/workload-identities/service-accounts/api-keys/manage-api-keys.md#cloud-cloud-api-keys) by setting the following custom request headers:

```bash
curl --request POST '<CONFLUENT_CLOUD_KSQLDB_SERVER_ADDRESS>/ksql' \
[... additional headers ...]
--header 'X-Confluent-API-Key: <CONFLUENT_CLOUD_API_KEY>' \
--header 'X-Confluent-API-Secret: <CONFLUENT_CLOUD_API_SECRET>' \
-d '{"ksql": "<KSQL_CONNECTOR_MANAGEMENT_STATEMENTS>"}'
```

You won’t be prompted to acknowledge pricing for any `CREATE CONNECTOR` statements
issued even though the usual connector pricing still applies.

## ksqlDB Java Client

To issue ksqlDB connector management requests, including `createConnector()`,
`dropConnector()`, `listConnectors()`, and `describeConnector()`, from the
[ksqlDB Java client](/platform/current/ksqldb/developer-guide/java-client/java-client.html),
provide a [Confluent Cloud API key](../security/authenticate/workload-identities/service-accounts/api-keys/manage-api-keys.md#cloud-cloud-api-keys) by setting the following
custom request headers as part of your `ClientOptions`:

```java
Map<String, String> customHeaders = new HashMap<>();
customHeaders.put("X-Confluent-API-Key", "<CONFLUENT_CLOUD_API_KEY>");
customHeaders.put("X-Confluent-API-Secret", "<CONFLUENT_CLOUD_API_SECRET>");

ClientOptions clientOptions = ClientOptions.create();
// ... set additional options ...
clientOptions.setRequestHeaders(customHeaders);

Client client = Client.create(clientOptions);
```

You won’t be prompted to acknowledge pricing for any `createConnector()` requests
issued even though the usual connector pricing still applies.

## ksqlDB Migrations Tool

To apply migrations containing ksqlDB connector management requests using
the [ksqlDB migrations tool](/platform/current/ksqldb/operate-and-deploy/migrations-tool.html),
provide a [Confluent Cloud API key](../security/authenticate/workload-identities/service-accounts/api-keys/manage-api-keys.md#cloud-cloud-api-keys) by passing a custom
request headers file with the following contents, as part of applying your migrations:

```bash
# file contents located at /path/to/request_headers.txt
X-Confluent-API-Key: <CONFLUENT_CLOUD_API_KEY>
X-Confluent-API-Secret: <CONFLUENT_CLOUD_API_SECRET>
```

Pass the custom headers file when applying migrations with the `--headers` flag of
the `ksql-migrations apply` command:

```bash
ksql-migrations ... apply --headers /path/to/request_headers.txt
```

You won’t be prompted to acknowledge pricing for any `CREATE CONNECTOR` statements
applied as part of your migrations even though the usual connector pricing still applies.
