I'm using Amazon EC2, and I want to put an internet-facing ELB (load balancer) to 2 instances on a private subnet. I am using VPC with public and private subnets.
Screenshot 1: Both subnets attached
Screenshot 2: Only public subnet attached
My question is actually an extension to this question. After following all 6 steps mentioned in the accepted answer, I am still getting struck, my instance attached to ELB gets OutOfService. I have even tried with allowing ports in the Security Groups for EC2 instances and ELB, but it did not help.
Please help, I am breaking my head with this.
You need to attach only public subnets to your ELB, making sure that the availability zones those subnets are aligned with the availability zones of the private subnets that your instances are in. Make sure that your health check is working locally on the instance.
You can SSH into EC2 instances in a private subnet using SSH agent forwarding. This method allows you to securely connect to Linux instances in private Amazon VPC subnets via a bastion host (aka jump host) that is located in a public subnet.
The popular AWS Elastic Load Balancing Feature is now available within the Virtual Private Cloud (VPC).
The other SO question you referenced is spot on. Double/Triple check the following
HTTP:8080/health_check
, on the instance you can curl x.x.x.x:8080/health_check
(where x.x.x.x
is the private IP of the instance) and get a 200 response code. 0.0.0.0/0
to the internet gateway attached to your VPC.0.0.0.0/0
to a NAT instance or gateway in a public subnetIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With