2018 Modded Minecraft Server on AWS : Part 2 — Static IP with Elastic IP
Why do we want a Static IP?
Our Public IP assigned to our EC2 instance is not static and this can lead to confused players thinking our server is unavailable, or players waiting for us to deliver them an ever changing new IP.
Our IP can change for the multiple reasons:
- we turn off our server at night to save money
- spot pricing can turn our server off at anytime
- we change servers because we have an updated build (blue/green deploy)
Using AWS Elastic IP (EIP) we can reserve and attach a Static IP to our Minecraft server running on an EC2 instance.
Cost Considerations
EIPs are free as long as they are being used by a running instance.
Amazon charges $0.01 per hour for each reserve EIP not in use. The first 100 remapping in a given month are free, after that each remapping will cost $0.10 until the next month lapse.
To put that in perceptive if there is 730 hours in a month and we have a reserved a EIP not in use for that entire duration its going to cost $7.30 USD
Our t2.medium EC2 server is $0.0464 per hour and if we keep our server running for the entire 730 hours we are paying $33.88 USD per month.
So for example if we were to run our server on a schedule where its turned off at night. We would be incurring ~12¢ a day to keep that Static IP. An insignificant cost to keep our players happy.
Reserving and Attaching an Elastic IP
Under the EC2 service we need to look in the left hand column under Network & Security and select Elastic IPs.
Then lets Allocate new address
And proceed to Allocate
Now we have our Static IP
We’ll associate the address with our running EC2 instance
Select your instance and then Associate. I had named my instance “Minecraft Server” you may have not named yours.
You should be able to see your instance associated with your service
Then just edit your server info with your new static ip