deno-lambda
jsii
Our great sponsors
deno-lambda | jsii | |
---|---|---|
7 | 33 | |
842 | 2,553 | |
2.9% | 1.5% | |
6.7 | 9.4 | |
12 days ago | 11 days ago | |
TypeScript | TypeScript | |
MIT License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
deno-lambda
-
Enhancing AWS Lambda Security with Deno
Using Deno with AWS Lambda functions requires a custom runtime. You can build your own runtime or use one that already exists. If you’re concerned about security, I suggest maintaining a copy of an existing runtime and carefully inspecting updates or creating your own runtime. For this proof of concept, I deployed the Serverless Application Repository (SAR) app for Deno into my AWS account. I used the included Lambda layer and the provided.al2 Lambda runtime to create my Deno Lambda function. I created a file called index.ts with some basic JavaScript code that makes requests to two different websites and returns the HTTP status code of the response or a caught error. I then updated the function’s configuration to reference the exported handler function.
-
Deploying to Lambda with the custom layer, but brand new to Deno - how do I cache the AWS SDK? Is there a version packaged with the custom layer?
I'm doing a simple PoC / testing with Deno using https://github.com/hayd/deno-lambda and specifically the CDK instructions.
-
Big Changes Ahead for Deno
As I had mentioned, it requires using a Lambda Layer. See: https://github.com/hayd/deno-lambda/blob/2d90756a0f18b57f16e...
Using your own image (i.e. without using the base AWS image with the layer) you'd get even worse cold start times.
-
First Look at Lambda Powertools TypeScript
Decorators and TypeScript aren't supported out of the box in Lambda (without using deno) so we'll also need a transpilation step if we go this route. Fortunately this is a mostly solved problem for AWS CDK, AWS SAM and Serverless Framework users. If you want or need to roll your own, esbuild is a great place to start and seems to be the bundler of choice for this purpose.
-
Is there an easy way to deploy Deno to production like for example Node to AWS Elastic Beanstalk? Or something in the works? I want to use deno in production on AWS Amazon.
In addition to the stuff posted here, there's the deno-lambda project for deploying to AWS Lambda
-
What is missing in Deno?
Cloud hosting support. Deno runs fine in a container, but lambda/cloud function support is difficult on most providers. deno-lambda exists but it only applies to AWS and can't be used with all CICD tools. Deno Deploy also exists but it's pretty new.
jsii
-
The Stainless SDK Generator
What about jsii? The technology behind AWS sdks: https://aws.github.io/jsii/
Is Stainless similar, different?
-
AWS Makes Cloud Formation Stack Creation Up to 40% Faster
The libraries for other supported languages of CDK are built as wrappers for underlying JS or maybe TS code via https://github.com/aws/jsii
So all the core CDK code is written first in JS/TS and then stubs for the other languages are added
Unfortunately this is often done without consideration for how the other supported langs actually work, and artefacts of e.g. JS lack of support for kwargs leak through
This is why e.g. the typing in CDK Python is completely broken - pretty much uniformly the concrete types like "Resource" don't implement their corresponding interface like "IResource" (to a type checker)
(There are many other typing niggles like this but that's the most egregious and pervasive one)
At the end of the day, having to explicitly cast concrete types as their interface to satisfy type checker is a minor annoyance, albeit a stupid one that could have been avoided with more care in the core library.
I could live with that, but I encountered so many bugs and issues trying to use CDK on current project that it's now much clearer to me why every company I worked at previously was using Terraform.
Pretty sure some of those issues are ultimately CloudFormation ones. The cumbersome CF > CDK JS > CDK Python stack is great for obfuscating errors and making debugging hard or impossible though.
Pulumi do something similar, albeit with Go as the core language and Terraform underneath. From what I've seen with a little use they have a much more successful result though, Pulumi Python was not a complete mess, and deploys faster and more reliable with better error feedback. I guess they just took more care to get it right.
-
Infrastructure Manager: Provision Google Cloud Resources with Terraform
Every version of the CDK uses an interop layer and runs on top of the Typescript version
https://github.com/aws/jsii
And as far as TF supports services before CFT. Guess which is easier for an AWS employee to do - getting the CF service team to support a new service or just contribute to Terraform’s open source project?
I know of at least one service where the service team introduced the needed APIs and then an employee of AWS wrote the TF provider and contributed to the project before AWS’s own internal team added it to CFT.
Source: former AWS ProServe employee
- JSii allows code in any language to naturally interact with JavaScript classes
-
Cloud, why so difficult? 🤷♀️
To "meet developers where they are" is a beautiful tenet of AWS, and of the CDK, and inspired us to create awesome technology such as JSII and constructs.
-
Automating AWS API gateways v1 REST
Yeah both CDKTF and Pulumi piggyback on JSII, a class translator that supports the languages you've mentioned, which was used as a building base for CDK.
-
New open-source programming language for DevOps engineers by the creator of the CDK
The reason we chose to start with compilation to JavaScript and not some other popular cloud language is because JavaScript is currently one of the most used ones, and in addition, we are using JSII to write our SDK in Typescript and then export it for consumption in other languages, such as Go, Python, Java and others.
- Write SDK “base” in Rust, wrap in other languages?
-
CDKTF Frequently Asked Questions
The CDKTF CLI is implemented in TypeScript. Providers and resources are implemented in TypeScript as well. jsii is used to compile the providers and resources to the supported languages.
- 10 things about AWS CDK
What are some alternatives?
bun - Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
Pulumi - Pulumi - Infrastructure as Code in any programming language. Build infrastructure intuitively on any cloud using familiar languages 🚀
powertools-lambda-typescript - Powertools is a developer toolkit to implement Serverless best practices and increase developer velocity.
projen - Rapidly build modern applications with advanced configuration management
deploy_feedback - For reporting issues with Deno Deploy
awesome-projen - P6M7G8's Awesome Projen
aws-embedded-metrics-node - Amazon CloudWatch Embedded Metric Format Client Library
middy - 🛵 The stylish Node.js middleware engine for AWS Lambda 🛵
aws-cdk - The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
aws-xray-sdk-node - The official AWS X-Ray SDK for Node.js.
aws-sdk-js-v3 - Modularized AWS SDK for JavaScript.