Smaller, Faster, and Cheaper Coding Laptops via AWS

Written by Owen | Published 2020/12/13
Tech Story Tags: software-development | coding | laptop | cloud-computing | aws | computers | programming | amazon-web-services

TLDR Using an ephemeral AWS EC2 instance for development costs me less than $10 a year. The secret sauce is a CPU Alarm that shuts the instance down if you aren't using it. If you terminate your instance when you are done using it, you'll run a little over $0.01 an hour. The solution is free under AWS Free Tier, but that doesn't last forever. It'll run you $1.46 a week at 40 hours a week, $1.,84 a month, and $22.10 in a year, all assuming you are running the instance for 40 hours per week.via the TL;DR App

My Coding Laptop is Smaller, Faster, and Cheaper than Yours and it lives in an AWS Data Center!
I use an ephemeral AWS EC2 instance for development. It costs me less than $10 a year.
I have a desktop and smartphone. Getting a MacBook just for coding felt like overkill.

Architecture

The secret sauce is a CPU Alarm that shuts the instance down if you aren't using it.

Cost

EBS-$0.10 / GB month
EC2-$0.0104 / hour
Cost was a big consideration for me when designing and using this system. This solution is free under AWS Free Tier, but that doesn't last forever.
As seen below, if you terminate your instance when you are done using it, you'll run a little over $0.01 an hour. It'll run you $0.46 a week at 40 hours a week, $1.84 a month, and $22.10 a year, all assuming you are running the instance for 40 hours a week.
# A month has ~720 Hours
>>> hourly_ebs_cost = 8*0.10/720
>>> hourly_ebs_cost
0.0011111111111111111
>>> hourly_instance_cost = 0.0104
>>> total_hourly_cost = hourly_instance_cost + hourly_ebs_cost
>>> total_hourly_cost
0.01151111111111111111
# 1.15 ¢ hourly cost
>>> weekly_cost = total_hourly_cost * 40
>>> weekly_cost
0.46044444444444443
# At 40 hours a week, you'd spend $0.46
>>> monthly_cost = weekly_cost * 4
>>> monthly_cost
1.8417777777777777
# A month's usage at 40 hours a week, $1.84
>>> yearly_cost = monthly_cost * 12
>>> yearly_cost
22.101333333333333
# A year's usage at 40 hours a week, $22.10

Portability

I use a free version of [Terminus](https://terminus.com/) on all my devices. I can't recommend Terminus enough, it is a fantastic product.
Using cloud computing also lets me centralize all my secrets. I don't need to make a new IAM User or API Keys for myself when I get a new machine.

Experimenting

Treating my development machines as Cattle instead of Pets lets me experiment freely.
I never have to worry about breaking my python environment.

AMD64 vs ARM64

This tweet brought up an interesting point, with new Mac Laptops running on ARM CPUs, local testing becomes more complicated.
Using cloud machines for local development could help alleviate this issue.

Written by Owen | Owen loves coding and writing about coding. Check out his course on APIs https://gum.co/learnapi
Published by HackerNoon on 2020/12/13