f you are still experiencing connection issues with RedshiftSQLOperator, you should check your AWS Security Group settings to ensure your Redshift Serverless instance is accessible. Here's how you can do it:
Go to AWS Console → VPC → Security Groups. Find the Security Group attached to Redshift Serverless: Go to Redshift Serverless → Workgroup → Networking & Security. Note down the Security Group ID (e.g., sg-xxxxxxx). Modify the Security Group inbound rules: Go to "Inbound Rules" → Edit rules. Add a new rule: Type: Redshift Protocol: TCP Port: 5439 (default Redshift Serverless port) Source: If you are on a personal computer, add your public IP If you want to allow all connections (for testing only), use 0.0.0.0/0. Click "Save changes". If this rule was missing, it was likely the cause of your issue!
I’m a bit late to the party, but I hope this helps someone who might still be pulling their hair out over this issue.