0
votes

I am trying to connect Api Gateway to make the request to internal Elastic Beanstalk(on custom VPC, LB facing internal private subnets, instances on private subnets).

I manage to create the VPC and configure Beanstalk app as internal (all is green). I read about the subject and you can connect Api Gateway to VPC using VPCLink. VPCLink is related to an Network Elastic Balancer. But this balancer sees only the Beanstalk EC2 instance which is not ok. It should target the Beanstalk Load Balancer because Beanstalk has auto-scaling(an can create multiple instances based on your configuration).

Is this possible? and how to do it.

Thank you,

*From Lambda inside VPC is working ok, so one solution is Api Gateway->Lambda->Internal Beanstalk.

1
Did you end up using elastic beanstock to host APIs in the end? Did everything work out?jbooker

1 Answers

0
votes

Actually is possible by using the IP of the Application Load Balancer(ALB of Beanstalk app) in the NLB(network load balancer) target config. The thing that is needed is to use Lambda to update the NLB (based on some event - CloudWatch). Ip of ALB can change so based on DNS get the new ip(there is on the internet some python script, also is easy to do with node/js). So in the end you can use VPCLink. But I realise that this is more of an exercise and another approach would be better for this kind of application.