I'm trying to configure an EC2 instance Node.js web server that can use AutoScaling and LoadBalancer to adapt the server according to demand.
I have made an AMI of an EC2 instance that when manually used to create a new EC2 instance will be publicly available upon initialization without any further configuration.
I can make several of these instances manually and put them behind a LoadBalancer and it will show their status as being healthy.
I can use an AutoScaling Group to spin up multiple instances that are each publicly accessible.
I can manually place the instances generated by the AutoScaling Group into the Target Group associated with the LoadBalancer and it will show their status as being healthy.
However, when I attach a new AutoScaling Group to the LoadBalancer it creates new instances, but those instances register as 'unhealthy' in the Target Group.
Based on my other successes it seems like this is a problem with getting the AutoScaling Group and LoadBalancer to interface with each other.
UPDATE: It turns out the problem isn't to do with the combination of LoadBalancer and AutoScaling Group, there was a confounding factor with whether or or not the instances have a public IP address. The instances without a publicly accessible IP address (either with a public IP address in a private subnet or just without a public IP address at all) are registering as unhealthy. I'm not sure what this means, does anyone have any ideas?