These are just rough notes, maybe I'll clean them up later.
# This is the instance we'll be using.
INSTANCE_ID=i-0000000000
# Set this to the VPC CIDR block, or use 0.0.0.0/0 to forward all traffic through the instance.
VPC_CIDR=0.0.0.0/0
# Use this flag to forward DNS through SSH (for split horizon DNS records)
# If you don't need it for an environment, don't use it.
DNS_FLAG=--dns
# First add your ssh key to /home/ec2-user/.ssh/authorized_keys
# TODO: come up with a one-liner to do it.
aws ssm start-session --target $INSTANCE_ID
# Then run sshuttle.
sshuttle --ssh-cmd="ssh -o ProxyCommand='sh -c \"aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters portNumber=22\"'" --remote ec2-user@$INSTANCE_ID $DNS_FLAG $VPC_CIDR
With ssm-sshuttle:
Ping: 132ms
Download Mbps: 3.64
Upload Mbps: 1.22
Without:
Ping: 19ms
Download Mbps: 305.44
Upload Mbps: 51.47