I'd like to mention that I'm not an experienced tech person, but I've been trying to learn AWS through an online course and I'm stuck at a particular point:
I've created two target groups made up of two EC2 linux instances each, and some simple code as part of the user data for each instance.
#/bin/bash
yum update -y
yum install httpd -y
systemctl start httpd
systemctl enable httpd
cd /var/www/html
echo "This is an INSTANCE" > index.html
I then created an Application load balancer with an HTTP listener (port 80). The ALB has been associated with subnets that use a security group that definitely have public access (I've used the same security group for other exercises that have public access)
But every time, both target groups show a description of "
Health checks failed with these codes: [502]". I've tried everything I can think of and I've even tried doing some research, but couldn't figure it out.
Before anyone gets irritated, I haven't used Stack overflow before, so if this is a duplicate thread, I apologize, but in the other threads I saw, there were other, more complex conditions.
Does anyone have any ideas?