Skip to content

ttlequals0/autowire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autowire

Spins up a WireGuard VPN on AWS with one command. Tear it down when you're done -- you only pay for what you use.

Rewrite of autovpn (OpenVPN, bash, legacy boto). Now WireGuard, Python, boto3.

Prerequisites

  1. Python 3.11+
  2. uv for dependency management
  3. AWS credentials configured:
cat ~/.aws/credentials
[default]
aws_access_key_id = YOUR_KEY
aws_secret_access_key = YOUR_SECRET
  1. A WireGuard client (e.g., wg-quick, WireGuard app for macOS/iOS/Android)

Installation

git clone https://github.com/ttlequals0/autowire.git
cd autowire
uv sync

To install autowire as a standalone command (no uv run prefix needed):

uv pip install -e .

To update, git pull. Editable installs pick up code changes immediately. Run uv sync if dependencies changed.

Quick start

# Generate an SSH keypair for your region
autowire keygen --region us-east-1

# Create a WireGuard endpoint
autowire create --region us-east-1 --key-name us-east-1_vpnkey

# Connect (config file is saved to current directory)
sudo wg-quick up ./us-east-1_autowire.conf

# Check running instances
autowire status --region us-east-1

# Tear it down when done
autowire terminate --region us-east-1 --instance-id i-xxxx

Commands

Command What it does
autowire create Spin up a WireGuard endpoint
autowire terminate Tear down an endpoint
autowire status List running instances in a region
autowire cleanup Remove all autowire resources in a region
autowire keygen Generate an AWS SSH keypair
autowire delete-key Delete a keypair from AWS
autowire version Print version

Run autowire <command> --help for full options on each command.

Configuration

Autowire reads ~/.autowire.toml for defaults. CLI flags override config values.

[defaults]
region = "us-east-1"
instance_type = "t3.micro"
port = 51820
dns = "1.1.1.1, 1.0.0.1"
client_name = "autowire"
ssh_user = "ubuntu"

Use --config /path/to/file.toml to specify a different config file.

Development

uv sync
uv run pytest
uv run ruff check

Notes

  • Your AWS IAM user needs EC2 permissions (or Administrator access)
  • t3.micro is the default instance type -- plenty for a VPN
  • AMIs are looked up at runtime (Ubuntu 24.04 via SSM), nothing hardcoded
  • PRs welcome

About

Create On Demand Disposable WireGuard Endpoints on AWS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages