This serverless app creates consumers and workers that process incoming messages from an SQS queue. The workers convert an HTML (in an S3 bucket) to a pdf which is finally uploaded to the same bucket. Additionally, this serverless project uses iopipe for lambda tracing and debugging.
- SQS Queue to hold messages
- SNS Topic to handle CloudWatch Alarms
- DynamoDB table to persist configuration
- CloudWatch Schedule as cron replacement
- Three (
scale
,worker
,process
) AWS Lambda functions
- CloudWatch Alarms triggered by changes in queue length post to SNS
- SNS Topic triggers
scale
Lambda function - Function
scale
updates configuration in DynamoDB - CloudWatch Schedule invokes
consumer
everyx
minute(s) - Function
consumer
reads configuration from DynamoDB - Function
consumer
invokesworker
function(s)
yarn aws-init
: script to instantiate the serverless work environment (yarn install --> create s3 bucket to store html and pdf files --> generates serverless.env.yml)yarn deploy
: deploys your serverless code to AWSyarn test
: trigger tests (optional)sls invoke local -f worker --stage dev --path event.json
: will convert the sample html uploaded byyarn aws-init
to a pdf with unique file name
- Fix
html-pdf.spec.js
test scenario - Add unit tests
- Fix issue preventing asynchronous function tracing from appearing on iopipe