Deployment
Deployment guide for the RawStack Notification component.
The Notification service is an AWS Lambda function deployed and managed by the CDK infrastructure stack. It is triggered by Amazon EventBridge rules.
Build
cd services/notification
npm run buildThe compiled output in dist/ is the Lambda deployment package.
Deploy via CDK
The notification Lambda is included in the Core Stack. Deploying or updating it is done through the infrastructure:
cd infrastructure/aws
npm run cdk deploy coreCDK zips the compiled dist/ directory and uploads it to Lambda automatically.
EventBridge integration
The API publishes domain events to EventBridge. The CDK stack defines EventBridge rules that route specific event types to the notification Lambda. To add support for a new event:
- Implement and register a new strategy in the notification service (see Development)
- Add a matching EventBridge rule in the CDK Core Stack
- Deploy:
npm run cdk deploy core
Environment variables
Secrets (Resend API key, Twilio credentials) are set as Lambda environment variables by the CDK stack. Define them in infrastructure/aws/.env — they are injected at deploy time.
Never hard-code credentials in the Lambda source code or commit them to version control.