SQL Client Tool Considerations

Before you Begin

Capture the following parameters from the launched CloudFormation template as you will use them to configure your client tool.

https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks?filteringText=&filteringStatus=active&viewNested=true&hideStacks=false
  • RedshiftClusterEndpoint
  • RedshiftClusterPort
  • RedshiftClusterUser
  • RedshiftClusterPassword
  • RedshiftClusterDatabase
  • EC2HostName
  • EC2DeveloperPassword
  • EC2LoginUserName

Challenge

There are many options when connecting to your Redshift cluster. Choose the method you are most comfortable with:

Redshift Query Editor V2

Navigate to the Redshift Query editor v2 page. If prompted, you may need to configure the Query Editor.

On the left-hand side, click on the Redshift cluster you want to connect to.

A pop-up window should have opened.

  • If your IAM User/Role has the privilege “redshift:GetClusterCredentials”, you can use the Temporary credentials option.
  • Enter the Database name and user name. Using the values RedshiftClusterDatabase and RedshiftClusterUser you collected earlier. Click Create connection.

To use the Redshift Query Editor v2, your IAM user also requires access to the redshift-data:* privileges

JDBC Client Tool Local

  • A popular JDBC Client tool is SQL Workbench/J. Download the installation package for your operating system.
  • Once you have installed your third-party tool, you will need either a JDBC or ODBC driver. Amazon Redshift offers JDBC and ODBC drivers for download. See Connecting to an Amazon Redshift Cluster Using SQL Client Tools from the Amazon Redshift Documentation website.
  • Launch SQL Workbench/J and navigate to [File | Manage Drivers].
  • Select “Amazon Redshift” and set the driver Library location to where you downloaded the Redshift JDBC Driver. Click Ok.
  • Navigate to [File | Connect Window] to create a new connection profile and modify the following settings and once complete click on the “Test Connection” button.
    • Name - “DemoConnection”
    • Driver - Amazon Redshift (com.amazon.redshift.jdbc.Driver)
    • URL - jdbc:redshift://<RedshiftClusterEndpoint>/<RedshiftClusterDatabase>
    • Username - <RedshiftClusterUser>
    • Password - <RedshiftClusterPassword>
    • Autocommit - Enabled

JDBC Client Tool EC2

  • You can also remote connect using RDP to the Windows EC2 instance that was created by the Cloud Formation template. Simply download Remote Desktop application and connect to the desktop using the EC2LoginUserName, EC2DeveloperPassword and EC2HostName noted above.
  • From the EC2 machine, launch the pre-installed SQL Workbench/J application and connect to your cluster using the steps above.