Deploy Lambda REST API with Deno ??
Andrei Marius Diaconovici
?? Senior Node.js Developer & AWS Professional Solution Architect Consultant / Contractor / Freelancer | I help companies design and implement scalable software products using AWS serverless services
Hello ????,
My name is Andrei, I am a Senior NodeJS Developer
This post will guide you through designing a multi-endpoint lambda manager
As Christmas is just 2 months away, the application we’ll build is about the Christmas market event. (small houses around the city with Christmas theme products).
The architecture and the application flow are already present in this article posted two weeks ago.
I like this way of creating lambdas and consider it a valid solution to avoid having one lambda for one method as long as you do not create a big monolith function.
Last week I posted the same design pattern but using NodeJS. The deno version is inside a different lambda folder with the prefix “deno_”. (Repository Link)
Why Deno ???
Deno is a TypeScript runtime based on V8, Google's JavaScript runtime, like Node.js.
It supports TypeScript natively ??
It doesn't have a centralized package manager like npm ??
We could say that?Deno is the improved version of Node, which is a faster, more secure, and more modern tool to build apps. ??????
For more tutorials about getting started with Deno, you can use the official documentation.
___________________
领英推荐
Prerequisites:
___________________
How the Deno works on lambda?
As Deno is not available as an official runtime, it is needed to create a custom runtime.
There is already a custom runtime kept up-to-date created by Andy Hayden ????????. The runtime is shared as a Serverless App Repository. (link)
Official repository & documentation: https://github.com/hayd/deno-lambda
The Makefile and the Cloudformation Lambda template have been updated in order to deploy the lambda successfully.
The DynamoDB wrapper has been updated in order to support the DynamoDB version of the deno library.
Deployment command: ??
sam build -t cloudformation/main.yaml && sam deploy --capabilities CAPABILITY_IAM CAPABILITY_AUTO_EXPAND
__________________
That’s it! A simple AWS Lambda with Deno ?? that you can use inside your projects! ??
I hope it could help your journey into the AWS world ??
The deno_* lambda can be used as a starting development environment.
If you need any help or considerations, feel free to drop me a message ??
Information Technology Services Specialist presso Italdesign
2 年I was waiting Monday for this!