Issues Connecting AWS Sagemaker Glue Notebook to Redshift Serverless

0

I am trying to connect my AWS Glue notebook in Sagemaker Studio to Redshift Serverless, but I keep encountering a connection timeout error. The network mode is: Public internet access. To this mode, I have specified VPC, subnet and a security group.

Steps taken:

  1. Ensured that both Redshift and Sagemaker Studio are in the same VPC and subnet.
  2. Configured security groups to allow inbound and outbound traffic.
  3. Used the following connection code in my notebook:
import redshift_connector

# Connects to Redshift cluster
conn = redshift_connector.connect(
    host=HOST_NAME,
    database=DATABASE_NAME,
    user=USER_NAME,
    password=USER_PASSWORD
 )

Error: OperationalError: ('connection time out', TimeoutError(110, 'Connection timed out'))

Additionally, I was successfully able to connect using an EC2 instance which had the same VPC, subnet and security group as the studio.

Thank you in advance for your help.

1 Answer
0
  • Yes i tried using regional endpoint, but its still showing the same error

    One other information I missed sharing was that the network mode is: Public internet access. To this mode, I have specified VPC, subnets and security groups.

    Additionally, I was successfully able to connect using an EC2 instance which had the same VPC, subnet and security group as the studio.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions