Comments (8)
I am still not fully sold on this, I fear that there's too much overread in trying to uniform everything.
Anyway, I totally admit my opinion is just based on feeling, so I suppose what @dkatavic is proposing here is the most reasonable approach to take: let's start with a list of platform we could aim to support; let's list what are the different signatures and other important technical details to keep in mind.
Once this is done, it will probably become much easier to have an informed conversation and come up with a better plan.
Anyone here wants to own this research? @coryodaniel are you still interested? If you would like to contribute to this that would be awesome!
from middy.
Hello @coryodaniel and thanks for the appreciation on the project.
Supporting other FaaS solutions is definitely an idea worth exploring. The current implementation is bound to the FaaS API exposed by AWS, where a lambda (a function) is essentially a function with the following signature:
const mylambda = (event, context, callback) => {
// ... do stuff with `event` and `context`
// ... invoke `callback(null, result)` or `callback(error)` when done
}
I have other FaaS have slightly different signatures. I think it's doable to create a slightly more sophisticated middy runtime that can be configured to respect the signature of different FaaS services, but this is not a priority for me at the moment. I would prefer to have something more stable and complete for AWS and release version 1.0.0, from there I would probably start to explore something like this.
This is not to say that possible PR that experiments with this idea will be rejected, it's definitely something worth exploring, so feel free to propose your solution if you have already something in mind.
from middy.
That is a great idea @coryodaniel . It would be valuable to document the behaviors of more popular FaaS providers so that we know how are they providing their equivalent of context
and event
and how are they handling errors so that it is easier to abstract the behavior. I will keep an eye on this thread
from middy.
I think this will really grow our userbase, I think we should flag this for v2.
We'll need to do:
- either add in logic for how each cloud wraps their handlers or have
core-aws
,core-google
,core-azure
- rename
ssm
,secretManger
,dbManager
,s3KeyNormailzer
,http-event-normalizer
middlewares to indicateaws
only - Find someone that would interested owning all or part of this. Thumbs up this issue if you'd like to be considered for this.
from middy.
There's an obscure/abandoned(?) project under the serverless umbrella that provides an express like API, including middleware support, that is compatible with azure and aws. With one handler you can deploy to both clouds without any modifications. I found it months ago and there hasnt been any activity recently but wanted to share.
https://github.com/serverless/multicloud
https://github.com/wbreza/multicloud-demo
from middy.
Thanks for sharing.
from middy.
We wire up a quick prototype for azure since we are in dire need of a middleware library at work. It is heavily inspired by the middy API and others. I didn't fork middy since we didnt have time to completely revamp everything to work in Azure but I did stole some snippet from the readme (it is really good y'all). We just spent one day working on it and havent deployed it yet so it is not ready for production at all but it is a start.
https://github.com/Rapol/middizure
from middy.
As amazing as it would be to offer a multi-cloud serverless middleware, I don't see middy offering support outside of AWS anytime soon.
from middy.
Related Issues (20)
- Lambda throwing `Failed to resolve internal values` in secretsManagerMiddlewareBefore HOT 3
- Simple lib import fails with both `tsx` and `ts-node` HOT 2
- LLRT Support
- TypeScript error when using `S3Handler` type HOT 6
- middy 5.2.5 isn't available on npm HOT 1
- Please give more descriptive error when throwing "Failed to resolve internal values" in secrets-manager module HOT 2
- middy/http-cors disable defaults and don't add headers HOT 1
- Streamified response with empty body ignores other response attributes HOT 3
- `http-error-handler` to support Problem Details (RFC 9457) HOT 1
- http-error-handler : set custom test to return error instead of `statusCode` HOT 2
- http-error-handler: guidance/bug on using lambda-authorizer with v5 HOT 1
- error-logger: Call implementation function with await prefix HOT 1
- ApproximateReceiveCount limit on SqsPartialBatch HOT 5
- Conditional middleware HOT 3
- (Aware of other issues) No "exports" main defined in /var/task/node_modules/@middy/core/package.json HOT 7
- input-output-logger: replacer function is not called HOT 3
- Error: No "exports" main defined in /path/to/the/repo/node_modules/@middy/core/package.json HOT 1
- @middy/http-content-encoding not awaiting onError HOT 1
- Consistent multipart body parser response format HOT 1
- ✖ No "exports" main defined in ***i/node_modules/@middy/core/package.json
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from middy.