# Add an AWS Redshift connector

## Connector features

You can use the Toucan AWS Redshift connector to connect to your AWS Redshift account with a db\_credentials or aws\_credentiamls and access `tables` or `views` with a SQL query or by [using our no-code form ](https://docs-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/create-a-dataset-from-a-connector/code-mode-and-single-mode).

With this connection, you can fetch data from your Snowflake to fill your charts and dashboards.

{% hint style="info" %}
**Changelog**

**December 23**\
\- This connector is [NativeSQL](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/youprep-tm-native-sql) compatible\
\
**November 2024**\
\- This connector supports [hybrid pipelines](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/hybrid-pipeline)
{% endhint %}

## Configuring an AWS Redshift connection

Follow the steps described in [..](https://docs-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/setting-up-a-connector "mention"), choose `AWS Redshift` and fill out the form with the following info:

<table><thead><tr><th>Field</th><th width="123.2734375">Format / Type</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>Name (mandatory)</td><td>String</td><td>Use it to identify your connection</td><td><em>MyRedshiftConnection</em></td></tr><tr><td>Host (mandatory)</td><td>String</td><td>The hostname of the Amazon Redshift cluster</td><td><em>example-cluster.1111.us-west-2.redshift.amazonaws.com</em></td></tr><tr><td>Port (mandatory)</td><td>Integer</td><td>The listening port of your Redshift Database</td><td><em>5439</em></td></tr><tr><td>Cluster identifier (mandatory)</td><td>String</td><td>The cluster identifier of the Amazon Redshift cluster</td><td><em>example-cluster</em></td></tr><tr><td>Default database (optional)</td><td>String</td><td>The name of the database instance to connect to</td><td><em>default_db</em></td></tr><tr><td>AuthenticationMethod</td><td>Enum</td><td>Authentication mechanism that will be used to connect to your Redshift datasource :<br>- <code>db_credentials</code><br>- <code>aws_credentials</code> (This approach allows users to use AWS credentials and limit the permissions the connected user has. The user should have the right permissions to access the redshift database. To find some examples of rights permissions, see <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html">this documentation</a> and <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-overview.html">this one</a>.)<br>- <code>aws_profile</code>( <strong>CAUTION</strong>: This authentication method can only work for now with the self-hosted mode. For more details about the profile: <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html">AWS CLI Profile</a>, you must fill the <strong>db_user</strong> and <strong>profile</strong> fields. To find some examples of rights permissions, see <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html">this documentation</a> and <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-overview.html">this one</a>.)<br><br></td><td></td></tr><tr><td>Username</td><td>String</td><td>Mandatory for <code>db_credentials</code><br>The username to use for authentication with the Amazon Redshift cluster</td><td><em>dbuser</em></td></tr><tr><td>Password</td><td>String</td><td>Mandatory for <code>db_credentials</code><br>The password that will be used to authenticate to the Redshift cluster</td><td><em>abcD1234</em></td></tr><tr><td>Db user</td><td>String</td><td>Mandatory for <code>aws_credentials</code><br>and <code>aws_profile</code><br>The user ID to use with Amazon Redshift</td><td><em>awsuser</em></td></tr><tr><td>Access Key Id</td><td>String</td><td>Mandatory for <code>aws_credentials</code><br>The access key id of your aws account.</td><td><em>AKIAIOSFODNN7EXAMPLE</em></td></tr><tr><td>Secret Access Key</td><td>String</td><td>Mandatory for <code>aws_credentials</code><br>Secret access key to access to your redshift</td><td><em>wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</em></td></tr><tr><td>Session token</td><td>String</td><td>Optional for <code>aws_credentials</code></td><td><em>IQoJb3JpZ2luX2VjEOj//////////wEaCXVzLWVhc3QtMSJGMEQCIGN2...</em></td></tr><tr><td>Profile</td><td>String</td><td>Mandatory for <code>aws_profile</code><br>Your AWS profile</td><td><em>myawsprofile</em></td></tr><tr><td>Region</td><td>String</td><td>The region in which there is your aws account.</td><td><em>eu-west-3</em></td></tr><tr><td>Enable TCP keep-alive</td><td>Boolean</td><td>Disable TCP keep-alive by unticking this option. Disabling might be "<br>"required for long-running queries or if you are behind a firewall</td><td></td></tr><tr><td>Connection timeout</td><td>Integer</td><td>maximum length of time to wait for the server to respond. None by default</td><td><em>30</em> (default)</td></tr><tr><td>Retry Policy (optional)</td><td>Boolean</td><td><p><em>Boolean</em> allows to configure a retry policy if the connection is flaky.</p><ul><li>max attempts: maximum number of retries before giving up</li><li>max_delay: in seconds, above the connection is dropped</li><li>wait_time: time in seconds between each retry</li></ul></td><td></td></tr><tr><td>Slow Queries' Cache Expiration Time (optional)</td><td>Integer</td><td>Slow queries' cache expiration time in seconds</td><td></td></tr></tbody></table>

Click on the `TEST CONNECTION` button then `SAVE` the connection

{% hint style="success" %}
After successfully configuring the connector, you will be able to find it in the Connector section of the DataHub "Datasource" tab
{% endhint %}

{% hint style="warning" %}
To have the graphical database exploration in your connector, **you must promote access to the default dev database to your user**. This database contains a table pg\_database listing all available databases and the pg\_table\_def listing all available tables in the cluster's databases. Without this access to the dev database, you will face a warning error when testing the connection of your data provider.
{% endhint %}

## Create a dataset from a Redshift connection

To create a dataset from Redshift, click on the "create from icon"; you will then be able to:

* Select the `Database`
* Select the `Schema`
* Select `Table` or `Views`
* Only keep the columns you need

{% hint style="info" %}
For more info, see the dedicated section [creating-datasets](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/managing-datasets/creating-datasets "mention")
{% endhint %}

{% hint style="success" %}
After selecting data from your connector you will be able to create a dataset thanks to [YouPrep](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/overview-of-youprep-tm) using the selection as "source step".
{% endhint %}
