Connecting to a data warehouse using Amazon Redshift query editor v2
The query editor v2 is a client browser-based interface available on the AWS Management Console for running SQL queries on Amazon Redshift Serverless or provisioned cluster directly. Once you have created the data warehouse, you can use query editor to jumpstart querying the cluster without needing to set up the JDBC/ODBC driver. This recipe explains how to use query editor to access a Redshift data warehouse.
Query editor V2 allows you to do the following:
- Explore schemas
- Run multiple DDL and DML SQL commands
- Run single/multiple select statements
- View query execution details
- Save a query
- Download a query result set up to 100 MB in CSV, text, or HTML
Getting ready
To complete this recipe, you will need:
- An Amazon Redshift data warehouse (serverless or provisioned cluster)
- IAM user with access to Amazon Redshift and AWS Secrets Manager
- Store the database credentials in Amazon Secrets Manager using Recipe 2 in the Appendix
How to do it…
Here are the steps to query an Amazon Redshift data warehouse using the Amazon Redshift query editor v2.
- Navigate to AWS Redshift Console https://console.aws.amazon.com/redshiftv2 and select the query editor v2 from the navigation pane on the left.
- Choose the AWS Region (
eu-west-1) or corresponding region on the top right of the screen. - With query editor v2, all the Redshift data warehouses, both serverless and provisioned clusters, are listed on the console. Select the dots beside the cluster name and click Create connection:

Figure 1.6 – Creating a connection in query editor v2
- In the connection window, select Other ways to connect, and then select AWS Secrets Manager:

Figure 1.7 – Connection options in query editor v2
- In the Secret section, click on Choose a secret, select the correct secret, and click on Create connection.
- Now that you have successfully connected to the Redshift database, type the following query in the query editor:
SELECT current_user; - Then you can click on Run to execute the query.
The results of the query will appear in the Query Results section. You are now connected to the Amazon Redshift data warehouse and ready to execute more queries.