I'm trying to setup an EC2 instance in private subnet which will be accessible through ELB, which in turn is in public subnet. I created VPC having 2 private (us-east-1a, us-east-1b AZs) and two public (us-east-1a, us-east-1b AZs) subnets. EC2 is in private subnet as mentioned, its security group allows access from ELB sec group
All public subnets associated with ELB are in same AZ as their respective private counterparts.
Load balancer has egress rule in place to reach EC2 instance.
But still, the instance is marked as unhealthy, ELB can not reach EC2.
My networking skills are quite poor, I'm lost and don't know where to look. Any help would be greatly appreciated.
P.S. Launching EC2 in public subnet works just fine. ELB is able to access webserver without an issue. Launching in private subnet somehow breaks everything
Apparently Beanstalk EC2 instance should be placed either in public subnet or private subnet with NAT gateway. Isolated private subnets are not supported as EC2 needs to talk to Beanstalk API which are external AWS resources.
Source https://www.reddit.com/r/aws/comments/evhbwx/comment/ffwxnmg/