I have an Aurora database on a VPC. Today I needed to connect to that database through Lambda. Not really an issue except I needed internet access in that Lambda and so I had to setup the following:
igw
and associated that table with the new subnet I created in step 1.Main
route table and routed all traffic to the NAT.This gave me internet access in my Lambda, and by running the Lambda on the VPC, I also had access to my Aurora database.
However, I have now lost public access to this database through MySQL Workbench.
What do I need to configure to route the public traffic back to the VPC?
The fact that you could previously connect to the Amazon Aurora data base from your laptop suggests that Aurora was running in a Public Subnet. That is, a subnet that has a Route Table that sends Internet-bound traffic directly to the Internet Gateway.
You mention that you modified the Main
routing table. It is likely that this routing table is associated with your Public Subnet (where Aurora is located), and that it was previously configured to send traffic to the Internet Gateway. However, it was probably modified to send traffic to the NAT Gateway. Therefore, the subnet was effectively changed into a Private Subnet (with no Route Table entry that points to the Internet Gateway).
If you really do want your database in the public subnet, then the configuration would be:
0.0.0.0/0
) to the Internet GatewayNo private subnet is required since you want Aurora in a public subnet.
A more secure option would be:
To connect to Aurora from your laptop, you would SSH into the Jump Box and use port forwarding to access the Aurora database. This way, the database is not exposed to the Internet.
The public subnet would have a different route table than the private subnet (thus making them private/public).