Reputation: 32296
I have a load balancer that will listen to port 3306 (non-vpc) Using traceroute command I can see that it has internal IP 50.50.50.50 My Question is:
1) Should I use internal IP instead of internet-facing IP ?
2) Will I be charged more if I use internet-facing IP?
3) Will the performance improve if use Internal IP?
Upvotes: 0
Views: 2343
Reputation: 44284
ELBs don't have static IP addresses, as has been documented quite a few places (although there are some interesting HAProxy workarounds, and if you do DNS with Route53 you can get around it entirely).
As such, you're confusing three concepts. First, EC2 instances have private IPs. These come with the instance for free, but are not terribly meaningful unless you're inside a virtual private cloud. Second, EC2 instances can be assigned public "EIPs" (not to be confused with the CNAMEs via which you can ssh
to an instance) that are public IP addresses and can cost money at a high enough scale. Third, ELBs have IP addresses, but they are not static, so you're stuck with an extremely long CNAME that can't be used for a root domain, and basically just irritates nearly everyone, everywhere, including AWS support if you bother to ask them about it.
Port 3306 sounds like MySQL though, so you're not actually balancing traffic, yeah? Why not just slap an EIP onto your MySQL instance, set up the security group to only allow traffic in from sources you specify, and take the ELB entirely out of the equation? It'll cost you less, save you the trouble of CNAMEing the CNAME, and force you to put into place strict Security Group policies, which you'd have had to do with the ELB anyway.
Upvotes: 1