I have an Auto-Scaling group (min. 1 instance and max. 5) with my website running there. This first instance public IP is pointing to my domain "example.com" But when the auto-scaling group create another instance (due the load incrementation) with another public IP, if I try to access to the new instance, this IP doesn't resolve to my domain "example.com" till I include this new public IP into my host filename or into my dns manager (godaddy).
How could I solve this and automatise this process?
Thanks in advance Kind Regards KV
You need to place an AWS load balancer in front of your EC2 instances. Attach the auto-scaling group to the load balancer so that instances are automatically added to the load balancer's pool when they are created, and automatically removed from the pool when they are terminated. Point your domain name to the load balancer instead of individual instances.