This repository allows anyone to create and maintain their own VPN (using the open source version of OpenVPN) on AWS in under 15 minutes and a dozen clicks for as little as $2/month. No technical background is required or expected.
For more about what a VPN is and why you might want to use one, this post on Hackernoon is pretty good.
For more information about cost and technical details, refer to the details section.
Instructions are provided both in the form of screenshots and more detailed text.
1: Click "Launch Now" | 2: Log in (create account if needed) | 3: Click "Next" |
---|---|---|
4: Click "Next" two more times | 5: Acknolwedge and click "Create Stack" |
6: Click "Stack Info" |
7: Refresh until Status is "CREATE_COMPLETE" (about 5-10 minutes) |
8: Click "Outputs" | 9: Click the "ClientConfigurationUrl" link |
10: Click "Download" and save the client key |
11: Import the key into OpenVPN Connect |
12: You're connected |
Cloudformation is used in order to provision all of the resources (EC2 for running the VPN, S3 for storing the generated client key, etc.) in your own AWS account.
AMI ids vary by region, and only Amazon Linux supports the "latest" functionality. The list of AMI ids in the Cloudformation template were produced with the following steps:
copy([...document.querySelectorAll("tr.odd, tr.even")].map(x => "{\"" + x.cells[0].textContent + "\": {\"HVM64\": \"" + x.cells[6].textContent + "\"}}").join(",\n"))
Automatic updates are configured with the following code from ./setup_ec2.sh
:
# Configure unattended upgrades for Ubuntu
apt-get install unattended-upgrades update-notifier-common --assume-yes
dpkg-reconfigure --frontend noninteractive --priority=low unattended-upgrades
AUC=/etc/apt/apt.conf.d/20auto-upgrades
echo "APT::Periodic::Verbose \"1\";" >> "$AUC"
echo "Unattended-Upgrade::Automatic-Reboot \"true\";" >> "$AUC"
By default, spot instances are used as they are significantly cheaper. On the other hand, on-demand instances are eligible for the free tier and have better availability guarantees. It would not be difficult to change the Cloudformation template to allow for on-demand instances as well.
Travis runs an end-to-end test to ensure VPNs can be set up and used to access the internet
Additional security and client testing should be done.
In addition to the cost of the EC2 spot instance itself (based on market price), there are costs for storage (about $0.80/month), and network (about $0.10/GB/month).