getmoto / moto

A library that allows you to easily mock out tests based on AWS infrastructure.
http://docs.getmoto.org/en/latest/
Apache License 2.0
7.6k stars 2.03k forks source link

How can data around Cognito be persisted when using docker? #7783

Closed sion908 closed 1 month ago

sion908 commented 3 months ago

Moto always helps me. However, when I stop Docker, the data is lost. Is there a way to make it persistent? If there is, it would be helpful if it was written in the documentation. I especially use services related to cognito.

  mock-aws-local:
    image: motoserver/moto:latest
    environment:
      MOTO_PORT: 4000
    ports:
      - ${AWS_LOCAL_PORT:-4000}:4000
bblommers commented 3 months ago

Hi @sion908, there is no way to persist the state, but you can use the Recorder to re-rum a specific set of operations.

https://docs.getmoto.org/en/latest/docs/configuration/recorder/index.html

Does that help you?

sion908 commented 2 weeks ago

@bblommers sorry too late. I was do that before create user-pool,

curl $ENDPOINT_URL/moto-api/seed?a=42

Sorry for the delay in contacting you, but it was very helpful.