Connect to Amazon Redshift Using a Username and Password

You can try connecting with those credentials if you have a username and password for your Amazon Redshift cluster. You will need the following information.

1

Cluster Endpoint

2

Database Name

3

Username

4

Password (if not using IAM)

NOTE: To find your cluster endpoint and port, go to the AWS Console, navigate to the Redshift service, select your cluster, and look for the “Endpoint” information in the cluster details.

Look for the "Endpoint" information in the cluster details

Ask Eve To Connect To Amazon Redshift Using The Username and Password

Copy the prompt below to follow along

Eve, add a connection to Redshift called my_redshift, my cluster endpoint is MY_CLUSTER_ENDPOINT, my port is MY_PORT, my database is MY_DATABASE_NAME, my user is MY_USER_NAME, and my password is MY_PASSWORD. Allow all bots to have access.

Reference Example:

Eve, add a connection to Redshift called my_redshift, my cluster endpoint is default-workgroup.730335510242.us-east-2.redshift-serverless.amazonaws.com:5439/dev, my database is dev, my user is test_user, and my password is test_password. Allow all bots to have access.

Eve will then add the connection

Eve will indicate the connection was successful, or any issues she encounters. It’s ok if it takes her a few attempts to make the connection string correctly.

Eve successfully connects my_redshift

NOTE: If you have any trouble connecting, you can ask Eve to provide AWS CLI commands you can use to validate your login, authentication, endpoints etc.

Configure IAM Authentication to Amazon Redshift

For enhanced security, Amazon Redshift supports IAM authentication. This is the recommended approach for production environments. Follow these steps to set up IAM-based authentication:

Setup IAM Authentication

1

Step 1

First, ensure you have the AWS CLI installed and configured with appropriate credentials.

2

Step 2

Create an IAM role or user with the appropriate Redshift permissions.

At a minimum, you need:

   {
       "Version": "2012-10-17",
       "Statement": [
           {
               "Effect": "Allow",
               "Action": [
                   "redshift:GetClusterCredentials",
                   "redshift:DescribeClusters"
               ],
               "Resource": [
                   "arn:aws:redshift:region:account-id:cluster:cluster-name"
               ]
           }
       ]
   }

3

Step 3

 Either log into the AWS CLI, or configure your AWS credentials in your environment

   export AWS_ACCESS_KEY_ID=your_access_key
   export AWS_SECRET_ACCESS_KEY=your_secret_key
   export AWS_REGION=your_region

Add an IAM-based Connection to Amazon Redshift in Genesis

Tell Eve you want to connect to Redshift using IAM authentication

Copy the prompt below to follow along

Eve, add a connection to Redshift called my_redshift, use connection string: postgresql+psycopg2://iam@<your endpoint>:5439/dev.  Allow all bots to access.

Reference Example:

Eve, add a connection to Redshift called my_redshift, use connection string: postgresql+psycopg2://iam@default-workgroup.730335510242.us-east-2.redshift-serverless.amazonaws.com:5439/dev, allow all bots to access.

Eve adds a connection to Redshift

You can then check the Database Connections screen in Genesis GUI to see the new connection.

NOTE: If you have any trouble connecting, you can ask Eve to provide AWS CLI commands you can use to validate your login, authentication, endpoints etc.

Check your Database Connections

After setting up your password- or IAM-based connection, you can see the new connection on the Database Connections tab.

my_redshift and other databases connected appear here

Adding Redshift Schemas to the Harvest

After establishing the connection, you can add any schemas you’d like to the harvest. Generally, you’ll want to exclude the following system schemas unless you’re specifically looking to analyze detailed schema and usage information.

information_schema

pg_catalog

pg_internal

You can Ask Eve to list the schemas in your database if you want to harvest only specific schemas.

Copy the prompt below to follow along

Eve, harvest the data in the my_redshift database, excluding schemas: information_schema, pg_catalog, pg_internal

Eve adds the database to the harvest

After a few minutes, you can see results of the harvest on the Config / Harvester Summary page in the Genesis GUI.

Harvester Status is where you can see all of the data sources being harvested

Removing The Connection

 You also have the option to remove the connection.

NOTE: This will also remove related harvest information

remove the connection to my_redshift