AWS Lambdas Action Routing

I have been playing with AWS lambdas for a few weeks trying to create a project.  One of the complications which the standard approach to lambdas is that each handler is its own lambda.  This mean that for any shared models meed to go into a separate but for DAOs this is a little problem as you need to import AWS SDK into the separate project then exclude it before using it in your different lambda functions and it all gets a bit messy.

I have just come across a talk (included at the end).  Here he uses the AWS API gateway to append an action parameter to the JSON.  Using a little code within the app (here on GitHub) these requests are routed within the application to the relevant action to be performed.  This approach might not be best practice, as he highlights, but for a small prototype application this will allow applications to be developed much quicker and at a future stage it would be quite straight forward to split off the different Lambdas if the prototype is successful.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.