Learn Hadoop
Learn Hadoop

Reputation: 3060

AWS lambda - how to connect Internal oracle instance (say VPN / inside office network) from lambda

My application hosted in AWS and DB hosted on internal network (some times 10.x or can access via VPN network.) What could be your solution to access oracle from AWS.

Upvotes: 0

Views: 744

Answers (2)

Michael - sqlbot
Michael - sqlbot

Reputation: 179174

@HoratiuJeflea makes a good point about the latency problems with this setup but I would suggest that there is a much cleaner solution than exposing the on-premise database on a public IP and connecting across the Internet with a native client or a simple REST-like interface. If you do follow either of those paths, TLS is absolutely essential... but if you proposed this setup in my infrastructure, I wouldn't allow it, since there is another way that is arguably both simpler and inherently more secure (read: more difficult to misconfigure in an insecure way) at the same time.

By default, instances that you launch into an Amazon VPC can't communicate with your own (remote) network. You can enable access to your remote network from your VPC by attaching a virtual private gateway to the VPC, creating a custom route table, updating your security group rules, creating an AWS Site-to-Site VPN (Site-to-Site VPN) connection, and configuring routing to pass traffic through the connection.

https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html

Although this mentions "instances" (EC2), it is equally applicable to Lambda functions running in a VPC. Site-to-Site VPN creates a redundant pair of IPSec tunnels from your data center's firewall to AWS-provided hardware at the VPC, and allows the private networks to route traffic between them.

Upvotes: 0

Horatiu Jeflea
Horatiu Jeflea

Reputation: 7404

It's not really a good habit to keep compute and DB so far apart, it will cause a lot of latency and security issues. Also you need to expose your DB which again, imposes security risks.

But to find a solution, set a public IP for you internal DB and connect Lambda to it as usually (jdbc or other solution).

It is better if you expose a REST service which just fetches data from your DB, for example https://medium.com/voobans-tech-stories/how-to-quickly-create-a-simple-rest-api-for-sql-server-database-7ddb595f751a.

Upvotes: 1

Related Questions