应用程序负载平衡器和Lambda的用例是什么? [英] What are the use cases for application load balancers and Lambda?

查看:69
本文介绍了应用程序负载平衡器和Lambda的用例是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上周在ReInvent上,公告之一是ALB现在可以调用Lambas来服务HTTPS请求.由于我们已经可以将API网关连接到Lambdas,因此我对这个新功能解决了什么问题感到困惑.

On ReInvent last week, one of the announcements made was that an ALB can now invoke Lambas to serve HTTPS request. Since we can already connect API Gateway to Lambdas, I'm a bit puzzled as to what problem this new feature solves.

这就是公告- https://aws.amazon.com/about-aws/whats-new/2018/11/alb-can-now-invoke-lambda-functions-to-serv -https-requests/

有人可以举一些例子吗?

Can someone please give some examples?

推荐答案

解决的问题是,它允许使用Lambda函数处理HTTP请求并生成响应的另一种方式.

The problem this solves is that it allows yet another way to use Lambda functions to handle HTTP requests and generate responses.

...但是您已经可以使用API​​网关或CloudFront的Lambda @ Edge功能来做到这一点.

...but you can already do this with either API Gateway or CloudFront's Lambda@Edge feature.

那么,真的解决了什么问题?

So, what problem does it really solve?

将Lambda请求处理简化集成到使用ALB的以服务器为中心的应用程序中.

Simplified integration of Lambda request handling into server-centric applications that use ALB.

从某种意义上说,此功能提供了API网关功能的一部分,但它在重要方面有所不同-通过允许您轻松地将Lambda函数装入"现有的基于EC2的应用程序中的一组特定路径中

While this feature offers, in some sense, a subset of API Gateway's capability, it differs in an important way -- by allowing you to easily "mount" Lambda functions into a specific set of paths in your existing EC2-based application.

您可以选择特定的路径模式并将其仅发送到Lambda函数-在同一个域下,没有任何跨域复杂性,并且不需要通过您的EC2实例代理请求-同时继续从EC2服务其余的应用程序.避免在应用程序中使用跨域资源会简化很多事情,其中​​最重要的就是cookie和会话.

You can pick off specific path patterns and send only those to the Lambda function(s) -- under the same domain without any cross-domain complexity, and without needing to proxy the request through your EC2 instances -- while continuing to serve the rest of the app from EC2. Avoiding cross-domain resources within an application simplifies many things, not the least of which is cookies and sessions.

虽然在某些情况下您也可以使用它来代替API Gateway可以执行的操作,但并不是可以完全为Lambda函数设置ALB的想法,尽管您当然可以这样做.

While you could also use this in some cases to replace what API Gateway can do, the idea isn't really that you'd set an ALB exclusively for Lambda functions, although of course you could do that.

这篇关于应用程序负载平衡器和Lambda的用例是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆