I currently have two AWS beanstalk applications: One for my web app server (
web_beanstalk_env) and one for my api (
They are currently routed through Route 53 as
api.example.com => api_beanstalk_env and
example.com => web_beanstalk_env each pointing to their own load-balanced beanstalk deployment.
However due to CORS issues I would like route
example.com => web_beanstalk_env and
example.com/api => api_beanstalk_env instead.
I have been looking at introducing an application load-balancer on top, but I'm not sure how to set the targets as the beanstalk environments. Moreover I can't point to the autoscaled server targets because these will change with deployment. I might be able to set the autoscale groups as targets, but I'm thinking these also change with beanstalk config updates?
Does anyone have any experience with setting this up? Or is there another way?