I have both a Ubuntu based Instance/VM as well as a Ubuntu based container service running in Lightsail currently. Additionally I have a MsSQL RDS instance running in AWS in the same region in the regions default VPC.
I managed to successfully activate VPC peering in my Lightsail account. Additionally I have whitelisted connections from any Lightsail services by allowing connections from the full 172.26.0.0/16 IP range that Lightsail services use. This has allowed me to connect from my regular Instance/VM without issues. However from my Lighstail Container Service attempts to connect to the database timeout.
How can I get this working?
2 Answers 2
Make sure to verify that the routes are correctly set up in the subnet where your RDS instance is located. To do this: • Go to the VPC settings in your AWS Console. • Navigate to Subnets and select the subnet where your RDS instance is located. • Click on Route Tables.
There should be a route similar to this: • Destination: 172.26.0.0/16 • Target: pcx-******** (your VPC peering connection).
For some reason, when a peering connection is created, it doesn’t automatically add routes for subnets associated with an Internet Gateway (if that’s your case). You’ll need to manually add the route to enable communication.
1 Comment
It turns out that my RDS MsSQL was not in the region's default VPC like I thought. Once I moved the instance to the correct VPC everything started working properly.
Comments
Explore related questions
See similar questions with these tags.
2600:1f18:10ff:4c00::/56as well just in case its connecting via IPv6 and this did not help as well