Are they all static (elastic) IPs?
I have a similar alias file for the instances which have static IPs. But not all of my servers do. E.g. my loadbalancer has a static IP, but why would all of my app servers have one?
I have a similar script to generate names.