Lightweight, cloud‑native IP Address Management (IPAM) for AWS and GCP with an extensible provider model. Backend in Go, UI with Alpine.js, storage via in‑memory or SQLite.
- Prereqs: Go 1.24+
- Run (in‑memory):
make dev(orgo run ./cmd/cloudpam) - Open: http://localhost:8080
Features in the UI
- Create top‑level pools (CIDR).
- Explore selectable IPv4 blocks within a pool with pagination (10/50/100/All) and create sub‑pools from free blocks.
- Add driver:
go get modernc.org/sqlite@latest - Build with tag:
make sqlite-build(orgo build -tags sqlite -o cloudpam ./cmd/cloudpam) - Run with DSN:
make sqlite-run(orSQLITE_DSN='file:cloudpam.db?cache=shared&_fk=1' ./cloudpam)
- Makefile delegates to
justif installed; otherwise runs built-in fallbacks. - Common tasks:
make dev | build | sqlite-build | sqlite-run | fmt | lint | test | tidy - If you prefer Justfile directly:
just dev,just sqlite-run, etc.
- Release artifacts are multi-platform binaries (Linux/macOS/Windows on amd64/arm64) built with the
sqlitetag using the CGO-lessmodernc.org/sqlitedriver. - No system SQLite is required. Migrations are embedded and applied automatically.
- To use SQLite, set
SQLITE_DSN(defaults tofile:cloudpam.db?cache=shared&_fk=1when unset in sqlite builds). Examples:- Linux/macOS:
SQLITE_DSN='file:cloudpam.db?cache=shared&_fk=1' ./cloudpam - Windows (PowerShell):
$env:SQLITE_DSN='file:cloudpam.db?cache=shared&_fk=1'; .\cloudpam.exe
- Linux/macOS:
- SQLite builds run forward-only schema migrations automatically at startup; binaries embed SQL migrations.
- View schema status:
./cloudpam -migrate status(orcloudpam.exe -migrate statuson Windows). - Backward downgrades after applying migrations are not supported; take a file backup of your DB before major upgrades.
- Rolling upgrade (single node): stop old binary, start new; DB is reused in place.
- Compatibility:
schema_info.min_supported_schemaguards older binaries; follow release notes if a breaking schema change occurs. - Optional: set
APP_VERSIONto stamp migrations (e.g.,APP_VERSION=v1.2.3 ./cloudpam).
- This repo includes
.golangci.ymland a GitHub Actions workflow at.github/workflows/lint.yml. - CI pins Go
1.24.xand golangci-lintv2.1.6to avoid local toolchain mismatches.
Notes
- Without the
sqlitebuild tag, the server uses an in‑memory store and logs a hint ifSQLITE_DSNis set. - Current CIDR tools and validation target IPv4. IPv6 support is planned.
The REST contract is captured in docs/openapi.yaml (OpenAPI 3.1). Preview it locally with your preferred viewer or import it into Postman/Insomnia.
Common requests:
# Liveness probe
curl http://localhost:8080/healthz
# List pools
curl http://localhost:8080/api/v1/pools
# Create a /24 child pool under parent 1
curl -X POST http://localhost:8080/api/v1/pools \
-H "Content-Type: application/json" \
-d '{"name":"Prod-1","cidr":"10.0.1.0/24","parent_id":1}'
# Enumerate candidate /26 blocks for pool 1
curl "http://localhost:8080/api/v1/pools/1/blocks?new_prefix_len=26&page_size=50&page=1"
# List assigned blocks filtered by account IDs
curl "http://localhost:8080/api/v1/blocks?accounts=12,14&page_size=50&page=1"Errors use the JSON envelope {"error":"message","detail":"optional context"}. The live server also serves the spec at http://localhost:8080/openapi.yaml for tooling consumption.
- Validate the spec (Ruby/Psych sanity check):
just openapi-validate - Generate HTML docs (writes to
docs/openapi-html/):just openapi-html - Example client generation:
openapi-generator-cli generate -i docs/openapi.yaml -g typescript-fetch -o clients/ts
- Project plan:
docs/PROJECT_PLAN.md - Changelog:
docs/CHANGELOG.md - OpenAPI spec:
docs/openapi.yaml
The photos/ directory contains app screenshots (tracked via Git LFS). To enable LFS locally: git lfs install.
- Pools overview:
photos/pools.png
- Pool blocks with filters and tooltips:
photos/blocks.png
- IP Space visualization bar:
photos/visualization.png
- Bulk actions (Pools):
photos/bulk-actions-pools.png
- Accounts list and edit:
photos/accounts.png
- Analytics filters and charts:
photos/analytics.png
Suggested capture set (drop files into photos/ with these names):
pools.png,blocks.png,visualization.png,bulk-actions-pools.png,accounts.png,analytics.png
Automated capture (Playwright)
- Prereqs: Node 18+,
git lfs install, app running athttp://localhost:8080(or setAPP_URL). - From
code/cloudpam/:npm installnpx playwright install chromiumAPP_URL=http://localhost:8080 npm run screenshots
- Outputs to
photos/with the filenames above.
- Provider abstraction and fakes
- AWS/GCP discovery and reconciliation
- Allocator service and policies (VRFs, reservations)
- AuthN/Z and audit logging