What is Substrate?
Substrate is an event-sourced AWS emulator for testing the infrastructure code that drives AWS — CloudFormation, CDK, Terraform, and any SDK or CLI call — deterministically, offline, and with API-call cost metering, before you deploy to a real account.
It models what is observable through an AWS API call — request/response shapes, resource state and how it transitions over a simulated clock, error codes, and seedable outcomes — not what software inside a resource does. That boundary is what makes every run reproducible: API observations can be recorded as events and replayed identically, whereas a real workload's timing, scheduling, and I/O cannot. See Scope & Philosophy for the full reasoning.
Use it three ways
- As a server — run
substrate, point any AWS SDK/CLI at http://localhost:4566. This is how most consumers use it. See Endpoint Configuration. - As a Go test harness —
import "github.com/scttfrdmn/substrate/emulator", spin up an in-process server or deploy a CloudFormation template directly. See the Testing Guide. - As a pytest plugin —
pytest-substrate gives a server fixture with per-test state reset and boto3 pre-wired. It is installed from source until it is published to PyPI (#1616). See Getting Started.
Substrate is equally at home testing human-written and AI-generated infrastructure — the reproducibility, offline speed, and cost metering matter either way.
Every built-in service plugin, with the operations it routes, is listed in the generated coverage matrix.