Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've just set up a micro instance on EC2 (AMI ID ami-e59ca991). I had hoped to avoid charges for a year as my usage falls well within the bound of the free tier. I have been charged $0.01 for "regional data transfer". I read here that this is because my instance is talking to its self via it's external IP address.

From what I've Googled it looks like you can stop the charges by making sure that the instance uses its internal IP address. However, when I ping the hostname of my instance internally (via an ssh session) it resolves to the instances internal IP address.

How can I configure my instance so that I do not get these charges? Is it as simple as adding a line to my hosts file?

Additionally, is this the real reason for the charge? I'm concerned that I've misunderstood the pricing somewhere. I have Apace and MySQL (with phpmyadmin) running on the machine - could I be being charged for data transfer associated with these (I have only one flat HTML page and I have only logged in via phpmyadmin - I have no data in my database).

Edit:

Additionally, my user account on MySQL was declared as:

grant all privileges on *.* to 'peter'@'localhost';

Should I have instead used the internal hostname for the instance?

grant all privileges on *.* to 'peter@ip-x-x-x-x.eu-west-1.compute.internal';

Cheers,

Pete

share|improve this question

1 Answer 1

Just ensure you use external (yes - external) hostname (not IP address) in all your settings, rather than the instance IP address .. It will always use the cheapest route possible that way..

From inside EC2 - both the internal and external hostnames resolve to the internal IP (confusing - i know .. but its a great feature..)..

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.