What is the host name for Amazon Redshift JDBC driver

I have setup LocalStack in my windows machine and started with redshift and few other services. Then I created a cluster and a DB.

>awslocal redshift describe-clusters --cluster-identifier my-cluster
{
    "Clusters": [
        {
            "ClusterIdentifier": "my-cluster",
            "NodeType": "n1",
            "ClusterStatus": "available",
            "MasterUsername": "admin",
            "DBName": "my-db",
            "Endpoint": {
                "Address": "my-cluster.cg034hpkmmjt.us-east-1.redshift.amazonaws.com",
                "Port": 5439
            },
            ...
        }
    ]
}

It’s showing my-cluster.cg034hpkmmjt.us-east-1.redshift.amazonaws.com as the address, So including that, I have tried following URLs for my JDBC-Redshift driver but not success so far.

 1. "jdbc:redshift://localhost:4566/my-db"
 2. "jdbc:redshift://localhost:5439/my-db"
 3. "jdbc:redshift://my-cluster.cg034hpkmmjt.us-east-1.redshift.amazonaws.com:5439/my-db"

I also tried all of these URLs in SQL client tools as well (DBeaver & SQL Workbench/J ) but couldn’t connect to the DB.

But I know it’s working with python clients like AWS.Redshift in aws-sdk and boto3.client with localhost url and localstack running port.

Is there any other URL format or Port that that need to be used? or local stack is simply not supporting JDBC connections?

Hello @Tharaka,

Please have a look at our documentation on Redshift | Docs.

Note

The Community edition of LocalStack provides RedShift with mocked CRUD operations, while the Pro edition provides emulation capabilities.