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:
- Ensured that both Redshift and Sagemaker Studio are in the same VPC and subnet.
- Configured security groups to allow inbound and outbound traffic.
- 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.
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.