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.
- Python 3.11+
- uv for dependency management
- AWS credentials configured:
cat ~/.aws/credentials
[default]
aws_access_key_id = YOUR_KEY
aws_secret_access_key = YOUR_SECRET
- A WireGuard client (e.g.,
wg-quick, WireGuard app for macOS/iOS/Android)
git clone https://github.com/ttlequals0/autowire.git
cd autowire
uv syncTo 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.
# 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| 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.
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.
uv sync
uv run pytest
uv run ruff check- 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