Unused Elastic IPs are Billable but Used Elastic IPs don’t cost anything.
Doesn’t it seem wrong or strange to you? At least to me, it did, when I heard it for the first time.
Elastic IPs
Elastic IPs are permanent IP addresses that you provision from AWS console. They don’t get changed unless you delete them.
When you create an EC2 instance, it is assigned a public IP address. However, when you stop/terminate the instance, this public IP address is lost. Upon restarting the EC2 instance, a new IP address gets assigned to the EC2 instance. Having different IP addresses on every restart can be problematic as you will have to get the latest IP address for SSH-ing into it, for example.
Elastic IPs to rescue. You can provision an Elastic IP and allocate it with the EC2 instance. This way EC2 instance will maintain the provisioned Elastic IP address as its public IP address even if it restarts.
Elastic IPs are chargeable
It seems astonishing to say that used Elastic IPs are free, but unused Elastic IPs are chargeable. If you give this a second thought, it makes sense.
The fact is that you are paying for Elastic IPs anyways. After all you provision an Elastic IP from Amazon’s pool of IPv4 addresses, and there are costs attached to it that Amazon has to bear. Amazon deserves to be for any Elastic IPs that you provision whether you use it or not.
Used and unused Elastic IPs
When you create an Elastic IP, it will be unused. You allocated this Elastic IP to an EC2 instance which marks it as a used Elastic IP address. An Elastic IP can be unused again if:
- The EC2 instance is stopped
- The allocation of Elastic IP is removed from EC2 instance
- Network Interface of the EC2 instance is detached
Paying for used Elastic IPs
You don’t directly pay for any Elastic IPs when they are in use. However, they are associated with running EC2 instance (if they are said to be used). As you know, EC2 instances are pay-as-you-go, which means that while your EC2 instances are running you are paying —well, at least— something.