Reputation: 35
I have MySQL running on a private Ubuntu instance hosted outside of AWS. And I have few CSV files in a S3 bucket that I'd like to load into my MySQL database using AWS Glue ETL.
I'm actually following this guide where they connect S3 to on-premise PostgreSQL using AWS Glue connections. https://aws.amazon.com/blogs/big-data/how-to-access-and-analyze-on-premises-data-stores-using-aws-glue/
Using the GLUE catalog I've crawled my S3 successfully. I'm now trying to create a connection (AWS Glue > Data Catalog > Databses > Connections) between Glue and MySQL.
But when I test my JDBC connection I get this error
Check that your connection definition references your JDBC database with correct URL syntax, username, and password. Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
I have verified my JDBC string works correctly by using Google Data Studio's MySQL connector. And I can successfully access my database from Google Data Studio.
I have also set the following for MySQL and the firewall is allowing connections over 3306
/etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 0.0.0.0
wait_timeout=2814400
From reading the AWS document that I linked above, I'm guessing I should be configuring the VPC and subnet so that a successful VPN tunnel is established between my AWS account and on-premise MySQL database.
I've configured my security group as mentioned in the document Security Group Inbound setting Security Group Outbound setting
I'm also using the default VPC and subnet provided by AWS. I'm pretty new to VPC/subnets, so could anyone please help me set this up?
Upvotes: 1
Views: 1286
Reputation: 11
Yes, you need a VPN to connect AWS to your private database, as exposing IP to the internet is not the right way (not recommended).
Upvotes: 0
Reputation: 230
The Reachability Analyzer found under VPC Console would be the tool to test a connection.
And yes, yes you need basic network connectivity through vpn from aws to be able to do that, or you need to expose your db to the internet (don't do that).
Upvotes: 1