When I SSH into an Amazon instance without an elastic IP I use the public DNS name that is typically of the form ec2-79-125-100-3.eu-west-1.compute.amazonaws.com.
Is that DNS name always resolved into the same IP? I assume not, because otherwise there would be no point in buying elastic IP:s. But then what is then the point of including the IP address in the DNS name?
Also, since the IP that the DNS name resolves into is shared by many instances, how does Amazon know exactly which of those instances I’m ssh:ing into?
Each instance has it’s own ip. Even when it’s not elastic, it’s temporary, but it’s still unique to the instance. You don’t have 2 instances with the same ip. Otherwise, as you pointed out, there will be no way to know which server is requested when specifying the ip number.
The advantage of elastic ip is that your instance always has the same ip. Without it, you’ll get a new ip number each time you restart the instance. Notice that you don’t really “buy” elastic ip. You don’t pay for it when it’s used, meaning in the normal situation where you have a running instance with the elastic ip assigned to it.