• Stars
    star
    36
  • Rank 735,472 (Top 15 %)
  • Language
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cheapest AWS VPC NAT.

cfn-cheapest-nat

build status

Cheapest AWS VPC NAT solution for personal projects.

Context

The current solutions is:

  • EC2 running on Spot.
  • Auto Healing
    • automatically replaces the unhealthy instance.
    • re-attaches a persistent network interface to recover transport level details such as routes.

The solution is not:

  • Highly Available
    • instance unavailability will cause NAT disruption.
  • Fault Tolerant
    • the persistent network interface results in dependency on a single zone.

Logical Diagram

Logical Diagram

Deploy

STACK_NAME=examples-nat \
PRIVATE_ROUTE_TABLES=rtb-0eee90cf29e333813,rtb-0c1d060b614e74b88 \
PUBLIC_SUBNET=subnet-03ad595bb28ce7679 \
  ./bin/deploy

Testing

I use the AWS System Manager Session Manager to SSH into an instance in a private subnet utilizing the NAT and run:

yum install python python-pip -y \
 && pip install --upgrade pip \
 && pip install speedtest-cli \
 && speedtest-cli
Retrieving speedtest.net configuration...
Testing from Amazon.com (54.206.26.162)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Telstra (Sydney) [1.01 km]: 1.82 ms
Testing download speed................................................................................
Download: 3283.42 Mbit/s
Testing upload speed................................................................................................
Upload: 2274.26 Mbit/s

Costs

solution network cost/GB cost/hour** cost/month**
NAT Gateway 5-45 Gbps 0.059 0.059 42.48
NAT Instance (t3a.nano) 0-5 Gbps 0-0.114 0.0059 4.25
NAT Instance (t3a.nano) (spot) 0-5 Gbps 0-0.114 0.0018* 1.30*

* variable costs.

** region ap-southeast-2.

AMI

Documentation

Configuration

  • /etc/sysctl.d/10-nat-settings.conf
  • /usr/sbin/configure-pat.sh

More Repositories

1

forward-proxy

Minimal HTTP(S) forward proxy using 150LOC and only standard libraries.
Ruby
152
star
2

scorched_earth

Scorched Earth clone in JRuby with no dependencies.
Ruby
129
star
3

gohack

Experimental Go language CSGO exploit.
Go
68
star
4

lisp

Minimal Lisp interpreter using 75LOC and only standard libraries.
Ruby
52
star
5

gomem

A Go library for manipulating Windows processes.
Go
50
star
6

nebula

WebGL top down space shooter.
CoffeeScript
50
star
7

react-instagram-authless-feed

React component to provide a token-less Instagram feed.
JavaScript
49
star
8

angularjs-rss-reader

RSS reader in Javascript / AngularJS.
JavaScript
29
star
9

goforward

Go forward proxy with bandwidth limiting.
Go
27
star
10

poto

multi cloud storage to image gallery + image proxy + file api - 350 LOC.
Ruby
19
star
11

alpaca-desktop

Experimental OSX menu bar widget for Alpaca.
Ruby
19
star
12

call-graph

Capture execution and create dependency graphs.
Ruby
17
star
13

interceptor

Ruby method interceptors.
Ruby
10
star
14

trie

Ruby trie data structure.
Ruby
5
star
15

chingu-template

Simple template for a Chingu application.
Ruby
5
star
16

redux-paint

Simple "time-traveling" paint application.
TypeScript
5
star
17

simple-sinatra-sequel-blog

A simple blog with Sinatra and Sequel.
Ruby
4
star
18

tf-idf

Ruby Gem to calculate tf*idf
CSS
3
star
19

k8s-gitops

k8s gitops home lab.
Shell
3
star
20

gobackground

Golang, winuser.dll, advapi32.dll, to create a random unsplashed background binary.
Go
3
star
21

godll

Example of Go & Windows DLL build and usage.
Go
3
star
22

gobat2exe

Convert Windows batch files into executable files.
Go
3
star
23

vagrant-metasploit

2
star
24

pi-playbook

Configure Raspberry Pi with Ansible
2
star
25

chef-pptpd

Chef PPTPDrecipe.
Ruby
2
star
26

thread-pool

Ruby thread pool.
Ruby
2
star
27

gobot

Go learning exercise.
Go
1
star
28

cfn-static-website-with-lambda-at-edge

Static website hosted from an S3 Bucket delivered via Cloudfront with Lambda@Edge.
Shell
1
star
29

jamesmoriarty.github.io

Github Pages
HTML
1
star
30

cfn-vpc

A simple VPC including public and private subnets over multiple AZs.
1
star
31

react-email-signature

JavaScript
1
star
32

scala-robot

Scala
1
star
33

mini-aasm

A State Machine library intended to be compatible with lightweight implementations of the Ruby language using 100LOC and only standard libraries.
Ruby
1
star
34

scheduler-dataflow-demo

Java
1
star
35

chef-minidlna

Chef MiniDLNA recipe.
Ruby
1
star
36

experiment-nginx-proxy-pass-forward-proxy

1
star
37

rack-playbook

Deploy compatible rack apps with ansible.
Ruby
1
star
38

docker-pmd

Dockerfile for PMD an extensible cross-language static code analyzer.
Dockerfile
1
star
39

kotlin-robot

Kotlin
1
star
40

victoria-exposure-site-bot

Ruby
1
star
41

chef-qt-webkit-devel

Ruby
1
star
42

experiment-dns-resolve

1
star
43

k3s-host-network-experiment

Why did my minidlna setup stop working?
Shell
1
star
44

experiment-fail-fast-mirroring

Shell
1
star