If the event sent to domain x8EventBus has a EventType DOMAIN and DomainName that matches x8DomainName
then those events are processed by this pipeline. First it will persist the event in the event source
Domain Event Source Table then apply those events to the domain and store the updated domain state
in the Domains Table.
Note: Currently only available for Python Based Lambda Functions
Payload could be any valid json format, however it is required to provide a domain lambda layer with the following
format
Domain layer should have a file with name domain_handler.py
The domain handler must contain a Domain class
and another data class such as FileDomain, UserDomain, AccountDomain etc
@dataclass classFileDomain: DomainId: str Name: str OwnerId: str More Fields
defapply(self, domain_payload, event_time, event_type): self.Name = domain_payload["Name"]["S"] More Fields to match the Domain
classDomain:
@staticmethod deffrom_dynamo_item(item): return FileDomain( DomainId=item.DomainId, OwnerId=item.OwnerId, Name=item.Name More Fields to match the Domain )
@staticmethod defcreate_new(domain_id, user_id) -> FileDomain: now = datetime.utcnow() return FileDomain( DomainId=domain_id, OwnerId=user_id, Name="", More Fields to match the Domain )
@staticmethod defto_dynamo_item(domain: FileDomain): return { 'DomainId': domain.DomainId, 'OwnerId': domain.OwnerId, 'Name': domain.Name More Fields to match the Domain }
Output:
Events persisted in Domain Events Table and Domain updated in Domain Table
CloudKitect Event Sourcing Pattern
If the event sent to domain x8EventBus has a EventType DOMAIN and DomainName that matches x8DomainName then those events are processed by this pipeline. First it will persist the event in the event source Domain Event Source Table then apply those events to the domain and store the updated domain state in the Domains Table.
Note: Currently only available for Python Based Lambda Functions
Input: Domain Event
Payload could be any valid json format, however it is required to provide a domain lambda layer with the following format
Domain layer should have a file with name domain_handler.py The domain handler must contain a Domain class and another data class such as FileDomain, UserDomain, AccountDomain etc
Infrastructure Diagram
Output: Events persisted in Domain Events Table and Domain updated in Domain Table
Default Configuration
Default Event Pattern to match
Default Alarms
Note that the default alarm uses the WaAlarm construct, which sets up an alarm action to notify the SNS Topic AlarmEventsTopic by default.
Examples
Default Usage
Custom Configuration
Compliance
It addresses the following compliance requirements