Dynamic Load balancer in public VPC outbound trouble

I’m trying to setup a Load Balancer within a VPC and am having trouble setting up outbound connectivity.
I’ve seen lots of posts saying that I need to put the instances in a private subnet to let them connect with the internet through the NAT and the load balancer will route the internet traffic to the instances.
That looked perfect at first but it looks like it only works for instances manually created in the private subnet as I couldn’t figure out how to tell the load balancer to create instances in another subnet than the one it is in (my load balancer is configured to automatically spawn new instances when there is too much traffic).
Anyone know how to do that?

Thanks!

Answer

For those who have the same problem, here’s the solution:
You simply need to create an internet facing load balancer in your public vpc and make it create its instances in the same vpc.
You can’t do it on the web interface though as you will need to set the param “associate_public_ip_address” to True when creating the launch config, which is available through the command line only.
If you’re a Python user and are using boto, you may need to upgrade it if you don’t have this param (works great with boto 2.23.0).

Attribution
Source : Link , Question Author : koleror , Answer Author : EEAA

Leave a Comment