Documentation Data Sources Direct Connection

Connect to Amazon Redshift

Check out our step-by-step video showing how to connect your Amazon Redshift database to Chartio:

Redshift Security Groups

Note: If your database server, RDS instance, or Redshift cluster is on a private subnet of an Amazon VPC, follow our VPC connection instructions instead.

For Chartio to connect to your database, you’ll need to whitelist our inbound IP address ( 52.6.1.1/32 ) in your Cluster’s Security Group settings:

  1. Log in to the Redshift Management Console.
  2. Select Clusters from the left sidebar then select the cluster you want to connect to Chartio.
  3. From the Cluster Details page, navigate to the Properties tab and scroll to the Network and security section.
  4. Under VPC Security Groups, click the Security Group you want to use to whitelist Chartio.
  5. Click the Inbound Rules tab at the bottom of the page then click Edit.
  6. Click Add Rule to add a new Inbound Rule.
    a. Set the Type to Redshift.
    b. Adjust the Port, if needed.
    c. Enter the following into the Source field: 52.6.1.1/32
  7. Click Save.

Create a user with read-only permissions

You will need to create a new user and grant SELECT permissions to the tables the user (i.e., Chartio) will access.

  1. To create a new user, go back to the Redshift console and connect the query editor to your database and run the query below, replacing <username> and <password> with your new username and password combination.

    Note: The password must contain at least one uppercase, one lowercase, and one numeric character.

    CREATE USER <username> WITH PASSWORD ‘<password>’;
    
  2. To grant select permissions on all tables in a schema, run the query below, replacing <schema> with the name of your schema and <username> with the user you created above.

    GRANT SELECT ON ALL TABLES IN SCHEMA <schema> TO <username>;
    

    If you’d like to grant SELECT permissions on a table-by-table basis, you can run the query below to generate the queries to GRANT SELECT ON each table in a schema. You’ll then need to exclude any grant statements for tables that you don’t want the user to access.

    NOTE: The AWS Redshift query editor will not run multi-statement queries; it’s recommended you use SQL Workbench to connect to Redshift and run multiple queries at one time.

    SELECT 'GRANT SELECT ON '||schemaname||'."'||tablename||'" TO <username>;' FROM pg_tables WHERE schemaname IN ('<schema>') ORDER BY schemaname, tablename;
    

    Copy the output of this command and paste it into SQL workbench, but make sure to remove any lines for tables that you do not want the user to access.

    Use SQL Workbench to run multi-statement queries

Connect your data source to Chartio

  1. Go back to the Properties tab of your Redshift Cluster Details page.
  2. Under the Connection details section, copy the Endpoint up to but not including the colon (:).

    Copy the Endpoint up to but not including the colon

  3. Under the Database configurations section, also copy the Database name and the port number.
  4. In Chartio, go to Data > Add Data Source > Amazon Redshift and complete the Redshift data source connection form. Chartio validates each field as fill out the form.
  5. Click Connect when you’re done.
  6. If your data source connection is successful, you’ll be redirect to the Schema tab, where you can review your schemas and update them as needed. Click Apply to save your schemas.

Now you can explore your Redshift data in Chartio!

Query comment

To provide more context to where queries to your data source are coming from, Chartio includes a query comment to any queries we send; it looks similar to the following:

{
	"reason":"chart_editor",
	"user_email":"support@chartio.com",
	"datasource_id":123456,
	"dashboard_slug":"my-dashboard",
	"chart_id":1234567,
	"datasource_alias":"my data source",
	"organization_id":12345,
	"dataset_id":1231231,
	"is_manual":false,
	"dataset_name":"Dataset 1",
	"dashboard_id":456456
}

Redshift expiring SSL certificate

Chartio does not check the validity (signing) of their SSL certificate; we only check that you have one for encryption purposes. This shouldn’t affect the Chartio connection, but if you do run into issues with the connection, please let us know and we can investigate further.