Skip to content

Quickstart ​

Install ​

MethodCommand
go install (Go 1.27+)go install github.com/blackbirdworks/gopherstack@latest
BinaryDownload the archive for your OS from GitHub Releases
Dockerdocker run --rm -p 8000:8000 ghcr.io/blackbirdworks/gopherstack:latest

Release archives cover linux, darwin and windows on amd64 and arm64 (no windows/arm64). See Docker for Compose.

You also need AWS CLI v2. Docker is needed only for features that launch containers (Lambda images, the docker engines).

Start ​

bash
gopherstack          # listens on :8000
gopherstack health   # prints "ok" when the server is healthy

gopherstack start runs the server in a container (or a background process with --host). stop, status, logs and reset manage that instance.

Use the AWS CLI ​

Set any credentials and a region, or the CLI will not sign requests:

bash
export AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test AWS_DEFAULT_REGION=us-east-1
bash
aws --endpoint-url http://localhost:8000 s3 mb s3://my-bucket
aws --endpoint-url http://localhost:8000 sqs create-queue --queue-name my-queue
aws --endpoint-url http://localhost:8000 dynamodb create-table \
    --table-name Users \
    --attribute-definitions AttributeName=UserId,AttributeType=S \
    --key-schema AttributeName=UserId,KeyType=HASH \
    --billing-mode PAY_PER_REQUEST
aws --endpoint-url http://localhost:8000 sts get-caller-identity

Skip --endpoint-url ​

AWS CLI v2.13+ honours a global endpoint variable:

bash
export AWS_ENDPOINT_URL=http://localhost:8000
aws s3 ls

Or use the awsgs wrapper. It injects --endpoint-url unless you pass one.

bash
go install github.com/blackbirdworks/gopherstack/cmd/awsgs@latest
awsgs s3 mb s3://my-bucket
awsgs --awsgs-port 9000 s3 ls     # or AWSGS_PORT=9000 (GOPHERSTACK_PORT is the fallback)

--awsgs-host overrides the host.

Dashboard ​

http://localhost:8000/dashboard

Configuration ​

Every flag has an environment variable. Common ones:

FlagEnv varDefaultDescription
--portPORT8000HTTP port
--regionREGIONus-east-1Region (also reads AWS_DEFAULT_REGION, AWS_REGION)
--account-idACCOUNT_ID000000000000Account ID used in ARNs
--log-levelLOG_LEVELinfodebug, info, warn, error
--persistPERSISTfalseSave and restore state across restarts
--data-dirGOPHERSTACK_DATA_DIR~/.gopherstack/data, or /data in a containerPersistence directory
--demoDEMOfalseLoad demo data
--latency-msLATENCY_MS0Random latency in [0,N) ms per request
--s3-bucketS3_BUCKETSBuckets to create at startup (repeatable or comma-separated)
--tlsTLSfalseServe HTTPS; self-signed cert unless --tls-cert/--tls-key are set
--dns-addrDNS_ADDREnable embedded DNS, e.g. :10053
--dns-resolve-ipDNS_RESOLVE_IP127.0.0.1IP that synthetic hostnames resolve to
--elasticache-engineELASTICACHE_ENGINEembeddedembedded, stub, docker
--opensearch-engineOPENSEARCH_ENGINEstubstub, docker

gopherstack --help lists every flag; the full reference is Configuration. Per-service engine flags are in Engines.

Persistence ​

bash
gopherstack --persist

State is snapshotted 500 ms after the last mutation. See Persistence.

Pods ​

A pod is a named series of full-emulator snapshots. Each save adds a version: a zip holding manifest.json and one JSON snapshot per service.

bash
gopherstack pod save demo -m "seeded users"        # all services
gopherstack pod save demo --services s3,dynamodb   # subset
gopherstack pod list
gopherstack pod versions demo
gopherstack pod inspect demo --version 1
gopherstack pod load demo                          # latest, strategy=overwrite
gopherstack pod load demo --version 1 --strategy service-merge
gopherstack pod delete demo --version 1            # omit --version to delete the pod
gopherstack --pod-autoload demo:1                  # load at startup
StrategyEffect
overwriteReset every service, then restore the pod
service-mergeReplace only the services in the pod

pod load --merge merges per account and region instead of replacing whole services. For autoload, --pod-merge-strategy (GOPHERSTACK_POD_MERGE_STRATEGY) also accepts account-region-merge.

Pods are stored in <data-dir>/pods (--pod-dir). For an S3 store set --pod-s3-bucket, plus --pod-s3-prefix, --pod-s3-endpoint, --pod-s3-region, --pod-s3-access-key, --pod-s3-secret-key, --pod-s3-path-style. Without an endpoint it uses real AWS S3 and the default credential chain.

The pod subcommands call a running server (--endpoint, GOPHERSTACK_ENDPOINT, default http://localhost:8000).

HTTP API:

Method and pathPurpose
GET /_gopherstack/podsList pods
POST /_gopherstack/pods/{name}Save; body {"message","services"}
GET /_gopherstack/pods/{name}List versions
DELETE /_gopherstack/pods/{name}Delete; ?version= for one version
GET /_gopherstack/pods/{name}/versions/{version|latest}Inspect
POST /_gopherstack/pods/{name}/load?version=&strategy=&services=&merge=Load

POST /_gopherstack/snapshot returns the raw per-service snapshot data.

Next ​

Released under the MIT License.