The Outbox Pattern: A reliable way of saving state to your database and publishing a message/event to a message broker.
The sample project in this solution demonstrates how the outbox pattern can be achieved with using AWS DynamoDb as a backing persistence layer.
See these articles for more details on why the outbox pattern is critical to microservice architectures