DWG NO.LC‑001
REVv1.0.5
DRAWN BYYousaf Hamza
SCALE1 : N VUs

loadcannon

One scenario format for testing internal and public APIs — LB, direct IP, or hostname — with secrets resolved securely at run time, not hardcoded.

INSTALL
curl -fsSL https://yousafkhamza.github.io/loadcannon/install.sh | bash
SUSTAINED LOAD 0 VUs

quickstart

  1. 1
    loadcannon examples --write scenarios

    Pulls the bundled example files onto disk — the binary alone doesn't come with any.

  2. 2
    cp scenarios/example-public-https-domain.json my-api.json

    Pick whichever example matches your target (see the full set below), then edit my-api.json: the URL, auth, and endpoint paths.

  3. 3
    loadcannon validate --scenario my-api.json

    Resolves auth and fires one request. Confirms the config is right before spending VU-minutes on it.

  4. 4
    loadcannon run --scenario my-api.json

    Generates the k6 script, runs it, writes loadcannon-out/report.html.

  5. 5
    open loadcannon-out/report.html

    Read the results. Re-run loadcannon --help any time for this same sequence.

prerequisites

REQUIRED
k6

Runs the actual load. run and gen-k6 need it on PATH. Install guide →

IF USING SSM AUTH
AWS CLI

Needed when a scenario's token_source is ssm. Install guide →

IF USING TUNNEL-SSM.SH
Session Manager plugin

Needed by the AWS CLI to open SSM port-forwarding sessions. Install guide →

routing

PUBLIC
api.example.com

Plain hostname, HTTPS or HTTP. No network prerequisites.

INTERNAL · LB
internal-lb.company.internal

Run from a host on the VPN/VPC, or tunnel in via tunnel-ssm.sh.

DIRECT IP
10.20.4.17 + Host override

Bypasses DNS/round-robin to hit one node, SNI and Host header still correct.

capability

validate

Resolves auth and fires one baseline request before you spend VU-minutes on a broken config.

run

Generates a k6 script, executes it, renders an HTML report from the summary.

gen-k6

Emit the script without running it — hand off to a CI runner or another engineer.

tunnel-ssm.sh

Reach a private-subnet target via IAM-authenticated SSM port forwarding. No VPN, no open ports.

example files

Every one of these hits a real, public, always-on API — run loadcannon validate or loadcannon run against any of them right now, no account or real credentials needed. Raw JSON from main: right-click → Save As, or curl directly. Same six files loadcannon examples --write scenarios gives you. Their thresholds are set loose on purpose — these are free, shared, community-run services with no latency SLA, so an occasional breach reflects their infra, not loadcannon. Tighten the numbers once you swap in your own target.

PUBLIC · HTTPS · NO TOKEN
example-public-https-domain.json

Hits jsonplaceholder.typicode.com — a free fake REST API built for exactly this. No auth required. raw →

PUBLIC · HTTP (NO TLS) · NO TOKEN
example-public-http-domain.json

Hits httpbin.org over plain HTTP — a public HTTP-debugging service, no signup or API key. raw →

PUBLIC · DIRECT IP · NO TOKEN
example-public-direct-ip.json

Hits Cloudflare's 1.1.1.1 directly by IP with a Host-header override — a real, permanently stable public IP, so this demonstrates the direct-IP pattern without needing an internal target. raw →

INTERNAL-STYLE · DOMAIN · TOKEN REQUIRED
example-internal-lb-domain.json

Uses httpbin.org/bearer as a public stand-in for an internal LB endpoint — it accepts any non-empty bearer token, so it exercises the full auth-resolution path (token_source: env) before you point it at a real internal service. Set DEMO_TOKEN to literally anything. raw →

INTERNAL-STYLE · DIRECT IP · NO TOKEN
example-internal-direct-ip.json

Uses Google's 8.8.8.8 as a public stand-in, host-override + direct IP, no auth — the pattern for an unauthenticated internal healthcheck hit directly, bypassing the LB. raw →

INTERNAL · BLANK TEMPLATE
example-internal-template.json

Not a live demo — copy this per new internal service. Won't parse until you delete its _comment field, so it can't run by accident. raw →

reference

Full scenario schema, secret-source options (env / file / ssm / prompt), and release process: github.com/yousafkhamza/loadcannon