- Newest
- Most votes
- Most comments
Based on your setup, there are several potential issues preventing AWS Glue from connecting to your RDS PostgreSQL instance.
The main challenge appears to be your network security configuration. Since your RDS security group only allows PostgreSQL connections from the EC2 security group and nowhere else, Glue cannot directly connect to your RDS instance. Here are some key areas to check:
-
Security Group Configuration: AWS Glue needs its own security group that allows it to connect to the RDS instance. You'll need to modify your RDS security group to allow inbound connections on port 5432 from the Glue security group, not just from the EC2 security group.
-
Network Connectivity: Ensure that AWS Glue is configured to run in the same VPC as your RDS instance. Glue needs to be in a subnet that can route traffic to the RDS subnet.
-
Bidirectional Connectivity: Apache Spark (which Glue uses) requires bidirectional connectivity. Your Glue security group should have self-referencing inbound rules to allow connectivity between Glue workers.
-
IAM Permissions: Verify that the IAM role used by Glue has the necessary permissions to access both the Glue service and the RDS instance.
-
JDBC URL Format: Confirm your JDBC URL is correctly formatted for PostgreSQL.
-
Database Credentials: Ensure the username and password in your Glue connection are correct.
Since you're using SSH tunneling for other connections, note that AWS Glue doesn't natively support SSH tunneling to connect to databases. You'll need to modify your security architecture to allow direct connections from Glue to RDS.
Consider using the AWSSupport-TroubleshootGlueConnection runbook in AWS Systems Manager to help identify specific connection issues between Glue and your RDS instance.
Sources
Troublehsoot AWS Glue connection to a JDBC data source | AWS re:Post
AWS Glue Connection to RDS SQL Server Fails – "Failed status due to failed connection" | AWS re:Post
Troubleshooting connections to your RDS for PostgreSQL instance - Amazon Relational Database Service
Troubleshooting connection issues in AWS Glue - AWS Glue
Relevant content
- asked 4 years ago
- asked a year ago
- AWS OFFICIALUpdated 8 months ago
