I often need to run software that requires multiple cores on AWS EC2 every few months. The problem is the setup time: I have to spend hours installing the software, which is around 1 GB in size. After I finish my computations, I want to save the environment without accruing high costs when I'm not using it for months. What's the most cost-effective way to keep my environment saved while minimizing expenses? Any suggestions would be greatly appreciated!
5 Answers
Hashicorp Packer is a solid tool for quickly creating AMI images of your EC2 instances, allowing for a faster and easier launch next time. Just remember to stop your instances when not in use; you’ll only pay for the storage.
You can create a snapshot of your EBS volume and then delete the EBS itself. Storing a snapshot for 1GB costs roughly $0.05 a month. Alternatively, consider creating an AMI from your EC2 instance, which can also help you save your setup for later use.
Using EFS instead of EBS could be a great option! I run a t4g.micro VM with a 10GB root EBS and no Elastic IP, so I avoid charges when it's stopped. I setup Tailscale to maintain access to my VM, and I use EFS for expandable storage. Once finished, I move data to S3 or delete it. This setup keeps costs under $1 a month.
AWS Batch is another service worth exploring. It can help manage and execute batch processing without the need to keep your EC2 instances running.
Consider turning your setup into a Docker image! You can push it to the public ECR, which is free for the first 50GB, giving you an ultra-low-cost solution.
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures