Resetting LocalStack

Resetting a LocalStack Session Between Chapters

The Community image keeps all state in memory: persistence and the state save and load endpoints belong to the paid Base and Ultimate plans, and 4.13.1 has no reset endpoint. Resetting means replacing the container, which also clears anything a broken stack left behind, such as the stuck deletion above:

Resetting LocalStack by removing its container, volume and Lambda containersShell
curl -s -o /dev/null -w '%{http_code}\n' -X POST localhost:31566/_localstack/state/reset
docker rm -f -v l1-localstack >/dev/null
docker ps -aq --filter name=l1-localstack-lambda | xargs -r docker rm -f
docker ps -a --filter name=l1-localstack --format '{{.Names}}' | wc -l
Output
404
2101b2f03c09
0

-v removes the image's anonymous volume, and the third line removed a Lambda 24 container that had outlived the emulator. Keep the image: Deploying the Network Stack's docker run starts an empty emulator in seconds, and the templates in Git 1,932 rebuild everything with Deploying the Network Stack and Full Stack Deploy. The running copy is disposable; the repository is the source of truth.