I'm doing my first Domain Driven Design (DDD) implementation. My architecture is comprised of .Net Core for defining my domain model, services, and building AWS Lambda functions. I am using Lambda functions as entry points to functionality into each bounded context.
In researching DDD, I've learned one approach for communication is publishing events from a bounded context allowing subscribers (within same bounded context, or external bounded contexts) to listen for and act upon the published event. I'm looking at Mediatr as a possible mechanism for publishing/subscribing to domain events.
I'm having a hard time connecting/understanding how to implement Mediator pattern using Mediatr for publishing/subscribing to events in a serverless environment. Specifically, how do I use Mediatr to publish an event and have a Lambda function subscribe to and act upon the event when it happens?
I know AWS offers Simple Notification Services (SNS) and Simple Queue Service (SQS) as means for notifications and these services can kick-off a Lambda function. I also know I can kick-off a SNS request from .Net Core. So, in my .Net Core code, should I simply replace Mediatr with calls to either SNS or SQS?
It seems to me SNS/SQS is an approach to the Mediator pattern allowing me to decouple my bounded contexts. If SNS/SQS is how you implement Mediator pattern within AWS & Lambda environment, then is Mediatr relegated for use in more traditional hosted applications?
Thank you for your time.