Amazon Redshift Sink Connector for Confluent Cloud

Note

If you are installing the connector locally for Confluent Platform, see Amazon Redshift Sink Connector for Confluent Platform.

The Kafka Connect Amazon Redshift Sink connector allows you to export data from Apache Kafka® topics to Amazon Redshift. The connector polls data from Kafka and writes this data to an Amazon Redshift database. Polling data is based on subscribed topics. Auto-creation of tables and limited auto-evolution are supported.

Important

Once this connector moves from Preview to Generally Availability (GA), it will require a subscription for Confluent Cloud commitment for Confluent Cloud Enterprise customers. Without a Confluent Cloud commitment, Confluent Cloud Enterprise customers will not have access to these connectors in GA. Contact your Confluent Account Executive to learn more and to update your subscription, if necessary.

Features

  • The Kafka Connect Amazon Redshift Sink connector inserts Kafka records into an Amazon Redshift database.
  • auto.create and auto-evolve are supported. If tables or columns are missing, they can be created automatically.
  • There is no primary key support.

Refer to Cloud connector limitations for additional information.

Caution

Preview connectors are not currently supported and are not recommended for production use. For specific connector limitations, see Cloud connector limitations.

Quick Start

Use this quick start to get up and running with the Confluent Cloud Amazon Redshift Sink connector. The quick start provides the basics of selecting the connector and configuring it to stream events to Amazon Redshift.

Prerequsites

Using the Confluent Cloud GUI

Step 1: Launch your Confluent Cloud cluster.

See the Confluent Cloud Quick Start for installation instructions.

Step 2: Add a connector.

Click Connectors > Add connector.

Add a connector

Step 3: Select your connector.

Click the Amazon Redshift Sink connector icon.

Step 4: Set up the connection.

Note

  • Make sure you have all your prerequisites completed.
  • An asterisk (*) designates a required entry.

Complete the following and click Continue.

  1. Select one or more topics.
  2. Enter a Connector Name.
  3. Enter your Kafka Cluster credentials. The credentials are either the API key and secret or the service account API key and secret.
  4. Select the message format for messages coming from the Kafka topic.
  5. Provide Redshift database connection information. For more information, see Getting Started with Amazon Redshift. Note the following:
    • In a Redshift cluster there is a single leader node. The Redshift Domain is the domain where the cluster leader is located. This is entered as a domain path. For example: redshift-cluster-1.cf3bzixkdiebh.us-east-1.redshift.amazonaws.com.
    • The default Redshift Port is port 5439.
  6. Enter the Redshift database details. Note the following:
    • Providing a Table name format is optional and defaults to the name of the Kafka topic. To create a table name format use the syntax ${topic}. For example, to create a table named kafka-orders based on a Kafka topic named orders, you would enter kafka-${topic} in this field.
    • The Database timezone defaults to UTC.
  7. Enter the Batch size. This is how many records to attempt to batch together. A typical value to use here is 3000 records.
  8. Select whether automatically creates a table or columns if they are missing relative to the input record schema.
  9. Enter the number of tasks for the connector. See Confluent Cloud connector limitations for additional task information.

Configuration properties that are not shown in the Confluent Cloud UI use the default values. For default values and property definitions, see Amazon Redshft Sink Connector Configuration Properties.

Step 5: Launch the connector.

Verify the connection details and click Launch.

Launch the connector

Step 6: Check the connector status.

The status for the connector should go from Provisioning to Running.

Step 7: Check the results in Redshift.

  1. From the AWS Management Console, go to your Redshift project.
  2. Verify that new records are being added to the database.

For additional information about this connector, see Amazon Redshift Sink Connector for Confluent Platform. Note that not all Confluent Platform connector features are provided in the Confluent Cloud connector.

Using the Confluent Cloud CLI

Complete the following steps to set up and run the connector using the Confluent Cloud CLI.

Note

Make sure you have all your prerequisites completed.

Step 1: List the available connectors.

Enter the following command to list available connectors:

ccloud connector-catalog list

Step 2: Show the required connector configuration properties.

Enter the following command to show the required connector properties:

ccloud connector-catalog describe <connector-catalog-name>

For example:

ccloud connector-catalog describe RedshiftSink

Example output:

Following are the required configs:
connector.class: RedshiftSink
name
kafka.api.key
kafka.api.secret
topics
input.data.format
aws.redshift.domain
aws.redshift.user
aws.redshift.password
aws.redshift.database
tasks.max

Step 3: Create the connector configuration file.

Create a JSON file that contains the connector configuration properties. The following example shows required and optional connector properties.

{
    "name": "redshift-sink-connector",
    "connector.class": "RedshiftSink",
    "kafka.api.key": "<my-kafka-api-key>",
    "kafka.api.secret": "<my-kafka-api-secret>",
    "topics": "<topic-name>",
    "input.data.format": "AVRO",
    "aws.redshift.domain": "<cluster-leader-path>",
    "aws.redshift.port": "5439",
    "aws.redshift.user": "<redshift-username>",
    "aws.redshift.password": "<redshift-user-password>",
    "aws.redshift.database": "<redshift-database-name>",
    "db.timezone": "UTC",
    "auto.create": "true",
    "auto.evolve": "true",
    "tasks.max": "1"
}

Note the following property definitions:

  • "name": Sets a name for your new connector.
  • "connector.class": Identifies the connector plugin name.
  • "topics": Identifies the topic name or a comma-separated list of topic names.
  • input.data.format: The input data format accepts AVRO only.
  • aws.redshift.domain: This is the domain path to the cluster leader node. For example: redshift-cluster-1.cf3bzixkdiebh.us-east-1.redshift.amazonaws.com.
  • "db.timesone": (Optional) The timezone for the datbase. Defaults to UTC. For a list of valid entries, see tz datbase time zones.
  • "auto.create" (tables) and "auto-evolve" (columns): (Optional) Sets whether to automatically create tables or columns if they are missing relative to the input record schema. If not entered in the configuration, both default to "false".
  • "tasks.max": Maximum number of tasks the connector can run. See Confluent Cloud connector limitations for additional task information.

Configuration properties that are not listed use the default values. For default values and property definitions, see Amazon Redshift Sink Connector Configuration Properties.

Step 4: Load the configuration file and create the connector.

Enter the following command to load the configuration and start the connector:

ccloud connector create --config <file-name>.json

For example:

ccloud connector create --config redshift-sink-config.json

Example output:

Created connector redshift-sink-connector jtt-ix4dl

Step 5: Check the connector status.

Enter the following command to check the connector status:

ccloud connector list

Example output:

ID          |       Name              | Status  | Type
+-----------+-------------------------+---------+------+
jtt-ix4dl   | redshift-sink-connector | RUNNING | sink

Step 6: Check the results in Redshift.

  1. From the AWS Management Console, go to your Redshift project.
  2. Verify that new records are being added to the database.

For additional information about this connector, see Amazon Redshift Sink Connector for Confluent Platform. Note that not all Confluent Platform connector features are provided in the Confluent Cloud connector.