I have database which is not exposed to public(running in ec2 instance which is in vpc). I have web-app running on ec2 which connects to database. I expose this web-app via application load balancer which also resides in vpc.
I want to access database as well call api in web-app from lambda function. To enable first connection I have setup lambda inside vpc and given security groups.
Do I need to setup NAT gateway(which is expensive) to access web-app via load balancer. I am aware that if lambda is inside vpc, it needs NAT gateway setup to call external services, However elb is not external resource.
Currently I am not able to access elb from lambda. My setup is as follows
ELB
meteor-app(application load balancer internet facing) (security groups: sg-6141c009, sg-edd58d86) in vpc vpc-1bedde72
Lambda
vpc: vpc-1bedde72, security groups: sg-0c53aa67, role: prod(with full EC2 access)
sg-0c53aa67 (on lambda) - no inbound rules
outbound rules: all traffic at all ports to any destination, TCP on port 443 at sg-6141c009
sg-6141c009(on elb)
inbound: https traffic from any source
outbound all traffic to any destination