How to avoid billing when using t2 and after releasing IP addresses?

Hi Everyone,

I have been billed under EC2 Elastic Compute Cloud while using t2.micro, here is the detail:

up to the point of this billing information I have only used t2.micro (I had mistakenly terminated one, but next day I got another. )

As wiki pointed out that when using t2, I will be charged if there is unused IP addressed. To avoid being charged for the unused IP address, we should release the unused IP address.

I think I have released all Elastic IP addresses.

So far, I have a t2.micro, a t2.large, and two Elastic IP addresses. for Both IP addresses, when I click Action, I have only two options available: Associate Address and disassociate Address. (release address is not available).

Was the reason why I continue to be charged that I released all IP addresses even after I stopped t2.micro?

In order to avoid being charged for like the picture shown, should I associate the two addresses again?

Thanks a lot


Hi Daniel!

To release the Elastic IP address you first need to disassociate it from your instance. Then you go to the Elastic IPs section of AWS console and release the address. After you done this address is returned to the pool and the next time you need to request a new Elastic IP and associate it with your instance. Note, that it will be another address!

Elastic IPs are typically used when you need DNS record pointing this IP which does not change. If you don’t bother with DNS you can ask Amazon to assign you public IP - it is free even when instance is stopped and will change when instance is stopped/started.

Hope this helps!

Thank you so much Alex!

I have no idea why would I need DNS so I think I will try public IP first. As for using public IP, I have a few questions on public IP:

  1. once I get public IP, I don’t need to worry or do anything about associate and release Elastic IP anymore, right?
  2. once I got public IP, and I stopped the instance and start again the next day, as public IP “will change when instance is stopped/started”, will I need to take more actions like finding what the new public IP number is and manually associating/linking the new public IP with my instance?

Thank you so much for your help!

Best wishes

  1. If you access your instances using public IP you don’t need Elastic IP anymore
  2. AWS attaches public IP automatically on start of your instance and releases it when the instance stops, so you don’t need to worry about it. However, you need to find out the new IP to connect to you server using SSH or web. You can do it in the web console or using aws aliases provided with the course.

Best regards!

1 Like

Thank you so much Alex, your reply is precise and very helpful!

Just in case it’s not clear - if you use an elastic IP, and leave it associated with your instance, you don’t have to pay for it. It makes life easier since you don’t have to worry about your IP changing every time you start your instance.

EDIT: this isn’t correct. If you stop the instance, you pay for the IP. It’s about $3.60 per month


Thanks for your reply Jeremy. However, my bill tells me that when my instances were in stopped status, ( I assume the only two Elastic IP were associated with my only Instances, as I only got two IPs) $0.005 per Elastic IP address not attached to a running instance per hour (prorated) kept counting hours and charged by hour.

So, as Alex suggested I have released all my Elastic IPs and use Public IPs at the moment. I will see whether this stops this type of charge in the next few days.

1 Like

Hi Jeremy, consider using aws for both deep learning part 1 and part 2 in the coming year, which support plan of AWS should I use?

I am on my own without a team, so I don’t have people to split bill with me to use AWH service.

I wonder whether AWS developer support plan $29/month is enough for both parts of our deep learning course?

If I choose this developer plan, what should I do to avoid extra charge?


Daniel, you can go with basic support plan which is free. It allows you to submit requests on general guidance, particularly the limit increase which is one you probably need to issue at the start of the course. It does not include technical support, though.

Charging for technical support and AWS service like EC2 are separate lines in your bill.

Be aware that AWS also charges for EBS volumes associated with your instance even when the instance is stopped.

Thank you so much Alex, I did noticed EBS keep counting and charging me even when my instances are in stopped status. so, is there a way to avoid this charge when instances are stopped?

If I understand you correctly about developer plan, the $29/mon is paid for support servies, I am not getting unlimited time usage of p2 or t2 during the month. I will still be charged for p2 $0.9, and t2.large $0.09 each hour, along with EBS charge even when instances are stopped. Is this what you mean?

Thank you so much for your help


Hi, Daniel

The answer to the last question is yes.

You pay AWS for storing your data on EBS so the only way to stop charges is to delete EBS volume. But then you will lose all your data and setup - not a good option. All charges stop when you terminate (not stop) you instances, delete EBS volumes (may be deleted manually when instance is terminated - depends on your settings) and release Elastic IPs.

To sum up, AWS charges you

  1. For running p2.xlarge instance - $0.9 per hour
  2. For 128 Gb EBS volume - $12.8 per month (given the price $0.1 per Gb*month), does not depend if your instance is running or not
  3. For allocated Elastic IP - $0.005 per hour when you instance is stopped

Hope this help!


Thank you so much Alex, you are very precise and helpful!

A little confused here.
Jeremy said

if you use an elastic IP, and leave it associated with your instance, you don’t have to pay for it.

In AWS bill, it says

$0.005 per Elastic IP address not attached to a running instance per hour (prorated)

It looks like I do need to release elastic IP to avoid charges which will force me to worry about changing IPs.

Is that correct?

1 Like

according to my bill, once I removed (or disassociated) all Elastic IP, and use Public IP as Alex suggested, $0.005 per Elastic IP address not attached to a running instance per hour (prorated) stopped counting.

However, EBS keeps counting and charging, at a much higher rate than Elastic IP at $0.1 per hour even when my instances are stopped.

Hope this helps

Good point - I apologize my earlier comment was misleading. I forgot that stopping an instance means you pay for the elastic IP. Having said that, it’s only $3.60 per month, so maybe not worth worrying about too much!

1 Like

Hi Alex,

I wonder how EBS volume is calculated.

Suppose my conditions are as follows: at the first day of a month

  1. I have two instances: t2.large, p2.xlarge
  2. two datasets: dogs (1G), cats (1G)
  3. I have downloaded both datasets onto t2.large
  4. I have not downloaded anything to p2.xlarge yet

My questions:

  1. Is EBS storage my provisioned storage volume? Is it 2 G?

  2. If I run some model on dogs dataset, then actual usage is 1G, but charged by size of 2G, right?

  3. If on the second day I delete 1.8G dataset from t2.large instance and add 1G dataset onto p2.xlarge instance, then my provisioned storage volume is changed to 1.2G, right? and the EBS charge is based on volume 1.2G, not 2G anymore, right?

  4. If on the third day I delete the 1.2 G dataset, then my provisioned storage volume is 0, meaning charge on EBS will stop on this day. right?

  5. In reality, at the moment I have only downloaded dogscats dataset and kaggle cats and dogs dataset onto t2.large, both together is less than 2 G I think. But why my EBS now has used up 30GB-mo free and also used another 12.3 GB-mo? I wonder how this 42.3 GB-mo is calculated?

Thanks in advance,


Hi Daniel,

EBS volume is provisioned in advance when you run script. Here is part of script

--block-device-mapping "[ 
  { "DeviceName": "/dev/sda1", 
    "Ebs": { 
          "VolumeSize": 128, 
          "VolumeType": "gp2" 
  } ]"

It says it provisions 128 Gb volume of SSD storage. In your case you have 256 Gb = 128 Gb x 2 provisioned no matter how much data is actually on this volume. So each day you are billed for 256 Gb x $0.1 / (Gb * month) /30 days ~ $1

Thank you very much Alex,

I found it in and files, so I understand why my EBS volume is 128G x 2.

Since we are suggested to have both p2.xlarge and t2.large at the same time and I believe it is wise to do so, then I wonder whether 128G is really necessary for me taking this deep learning course:

My conditions:

  1. having two datasets on cats and dogs on t2 instance is no more than 2 G, I think;
  2. If I download both datasets onto p2 as well, then in total my storage volume is less than 4 G;

My Questions: (could @jeremy also have a look? thanks)

  1. Is 128G x 2 for two instances really necessary for me doing homework for deep learning course?
  2. if not, then would 10G as EBS volume be enough for doing homework, given I only keep one or two datasets on Instance?
  3. If 10G is enough, then all I need to do is to terminate both t2 and p2, and change 128G to 10G in the setup scripts, and run those scripts again to get new p2.xlarge and t2.large. Right?

Thanks a lot!


1 Like

You could make your t2 much smaller. @vshets created a smaller instance and documented his approach - search his posts to see the details. It wasn’t as straightforward as just changing the size in the script, unfortunately.

Thanks Jeremy, I am looking into it to see whether I can make it in the end.

So, you still recommend p2.xlarge to be 128GB to be necessary for this course, right?

Happy New Year, and thank you again for this wonderful course you and Rachel created!