Runlet is an open-source, event-driven self-hosted GitHub Actions runner orchestrator on AWS built in Go (provided.al2023, ARM64) and Terraform.
When a GitHub Actions workflow job queues with a matching runner label (such as runlet-arm64), Runlet wakes up via webhook, authenticates as a GitHub App, mints a single-use Just-in-Time (generate-jitconfig) configuration, provisions an ephemeral EC2 instance, runs the single job, and terminates the instance immediately upon exit—with $0 idle compute cost.
See ARCHITECTURE.md for sequence diagrams, IAM boundaries, and engineering trade-offs.
- Go
1.26+(for local tests and buildingprovided.al2023ARM64 Lambda zips) - Terraform
1.6+ - AWS CLI v2 configured with target account permissions
- Packer
1.11+(optional, for pre-baked fast-boot AMIs; stock Ubuntu 24.04 LTS works out of the box)
- In GitHub Settings -> Developer settings -> GitHub Apps -> New GitHub App:
- Webhook URL: temporarily use a placeholder (you will update it with Terraform's
webhook_urloutput). - Webhook secret: generate a strong random secret (
openssl rand -hex 32). - Repository permissions:
Actions: Read-onlyAdministration: Read & write (required for repositorygenerate-jitconfigand runner deletion rollback)
- (If using
runner_scope = "org", grant Organization permissionSelf-hosted runners: Read & writeinstead.) - Subscribe to events: check Workflow job.
- Webhook URL: temporarily use a placeholder (you will update it with Terraform's
- Generate and download the App's Private key (
.pem), note the App ID, and install the App onto your target repository or organization.
Populate the two SecureString parameters before running terraform apply:
aws ssm put-parameter \
--name "/runlet/github/webhook-secret" \
--type "SecureString" \
--value "YOUR_WEBHOOK_SECRET"
aws ssm put-parameter \
--name "/runlet/github/app-private-key" \
--type "SecureString" \
--value "$(cat path/to/github-app.private-key.pem)"make test
make package
cd infra/envs/prod
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars and set github_app_id (and optional pools / spot / region)
terraform init
terraform applyNote: On AWS Free Tier accounts where
c7g.mediumis restricted, you can uset4g.smallinterraform.tfvars(automatically configured withcpu_credits = "standard").
Copy the webhook_url output from Terraform into your GitHub App's Webhook URL setting.
Without a custom AMI, scripts/runner-bootstrap.sh automatically installs AWS CLI v2, docker, git, and SHA-256-verified actions/runner on stock Ubuntu 24.04 LTS (~90s boot). To cut startup latency to ~25–35s:
packer init packer/runner.pkr.hcl
packer build -var "aws_region=us-east-1" packer/runner.pkr.hclSet the resulting AMI ID in pools["runlet-arm64"].ami_id inside infra/envs/prod/terraform.tfvars and re-run terraform apply.
- Trigger
.github/workflows/demo-runlet.ymlvia Actions -> Demo Runlet Ephemeral Runner -> Run workflow. - Confirm the job executes on
aarch64asrunnerwith no/run/runlet-jitfile present. - Verify in the EC2 console (or via
aws ec2 describe-instances --filters Name=tag:runlet:managed,Values=true) that the instance transitions toterminatedimmediately after the job completes.
cd infra/envs/prod
terraform destroyDelete /runlet/github/webhook-secret and /runlet/github/app-private-key from SSM Parameter Store if no longer needed.