How I Got Charged for an Elastic IP — And What I Learned About Cleaning Up AWS Resources

Introduction
When I started experimenting with AWS as part of my journey into cloud and DevOps, I was focused on learning how to launch EC2 instances, SSH into them, and set up web servers. What I didn't expect was to get charged for something I wasn't even actively using: an Elastic IP. In this post, I want to share what happened, what I learned, and how you can avoid this common beginner mistake.
What Is an Elastic IP?
An Elastic IP (EIP) is a static public IPv4 address provided by AWS. Unlike regular public IPs (which change when you stop and start an instance), an Elastic IP remains the same until you explicitly release it. It's particularly useful if you want to ensure a consistent IP address for your application or server.
However, there's a catch: while Elastic IPs are free when attached to a running EC2 instance, they incur charges when they're not in use.
My Mistake
I tried using the AWS CLI to create an EC2 instance from my terminal. I wrote a script and ran it, but it didn’t seem to work. I tried again, and the result was the same. So I left it and instead used the AWS Management Console, which worked immediately.
What I didn’t realize was that even though my CLI attempts failed, they somehow triggered the allocation of two Elastic IPs to my account. The next day, a little over 24 hours later, I received a billing alert. I was surprised and curious because I was still using the Free Tier and hadn’t expected any charges. That’s when I discovered the Elastic IPs were the cause.
Why AWS Charges for Idle Elastic IPs
AWS offers one Elastic IP per running EC2 instance for free. But once that IP is no longer attached to a running instance, it’s considered idle. The reason behind the charge is simple: AWS wants to prevent users from hoarding public IP addresses, which are a limited resource.
Here are the key points:
Free: When the Elastic IP is associated with a running instance.
Charged: If the instance is stopped or terminated but the Elastic IP remains allocated.
What I Learned About Resource Cleanup
This experience taught me a lot about how AWS billing works and why it's so important to clean up unused resources:
Releasing Elastic IPs: Terminating an instance does not automatically release the EIP. You have to do it manually.
Monitoring Costs: Even if your instance is off, your billing might still increase due to leftover resources.
Check the VPC section of your billing dashboard — that’s where Elastic IP charges show up.
Billing Alarms: Set up CloudWatch billing alarms to alert you if your usage goes above $0.01 or any threshold you’re comfortable with.
Tips to Avoid Elastic IP Charges
If you're a beginner using AWS Free Tier, here are a few tips to help avoid charges like this:
Use Elastic IPs only when necessary.
Prefer auto-assigned public IPs for short-term or test projects.
Always release unused Elastic IPs manually.
Set billing alerts early.
Regularly review the Cost Explorer or Billing Dashboard to track your usage.
Conclusion
Getting charged for an idle Elastic IP was frustrating at first, but it became a valuable lesson in AWS resource management. Now I know to double-check every service I'm using and to always clean up after myself. If you're just starting out with AWS, I hope this post saves you from a similar surprise.
Have you had a similar experience with AWS costs? Share your story or tips in the comments below
Subscribe to my newsletter
Read articles from Filbert Nana Blessing directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
