无服务器功能和Lambda函数有什么区别 [英] What is the difference between a Serverless Function, and a Lambda Function

查看:156
本文介绍了无服务器功能和Lambda函数有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在玩Cloudformation无服务器转换,并试图弄清楚如何以及何时使用AWS::Serverless::FunctionAWS::Lambda::Function.由于某种原因,Lambda版本用于AWS中的SAM示例.这非常令人困惑. SAM github .然后还有servlerless框架本身,它实际上是一个nodejs框架.这些东西让我非常困惑.

I am playing around with the Cloudformation Serverless Transformation, and am trying to figure out how and when to use AWS::Serverless::Function or AWS::Lambda::Function. For some reason the Lambda version is used for SAM examples in AWS. This is very confusing. SAM github. And then there is also the servlerless framework itself which is really a nodejs framework. All this stuff is getting me extremely confused.

推荐答案

首先,让我解释一下每一个.

First of all, let me explain each of these.

AWS无服务器堆栈-AWS提供的无服务器技术的组合,包括API网关,Lambda,S3等.

AWS Serverless Stack - A combination of AWS offered serverless technologies including API Gateway, Lambda, S3 and etc.

最初引入Lambda时,使用Cloudformation的这些技术来开发无服务器应用程序是一项挑战.该问题归因于为API Gateway和Lambda编写Cloudformation的复杂性.

When Lambda was initially introduced it was challenging to develop Serverless applications using these technologies using Cloudformation. The problem was due to the complexity of writing Cloudformation for API Gateway and Lambda.

这是Serverless Framework出现的地方.

This is where Serverless Framework came in.

无服务器框架-一个开放源代码DevOps框架,它使用一个名为serverless.yml的简单文件简化了API网关和Lambda的定义.由于无服务器框架在配置上使用约定,因此仅需几行代码即可定义Lambda,API网关等.无服务器框架下基于serverless.yml中定义的内容生成Cloudformation.此外,无服务器框架还支持多个云提供商.

Serverless Framework - An Open Source DevOps framework which simplifies defining API Gateway and Lambda using a simple file called serverless.yml. Since Serverless Framework uses conventions over configurations, it required only a few lines of code to define Lambda, API Gateway and etc. Underneath Serverless Framework generates Cloudformation based on whats defined in serverless.yml. In addition, Serverless Framework supported Multiple Cloud Providers.

后来,AWS引入了他们自己的简化脚本语言,称为AWS SAM(注意:AWS SAM到目前为止还不像Serverless那样具有插件和扩展支持的框架),以减少将CloudFormation定义为Serverless Framework的替代方案的复杂性.

Later AWS introduced their own simplified scripting language called AWS SAM(Note: AWS SAM is not a Framework like Serverless with plugins and extension support as of now) to reduce the complexity in defining CloudFormation as an alternative to Serverless Framework.

AWS::Lambda::Function是Cloudformation语法,用于定义Lambda函数.

AWS::Lambda::Function is the Cloudformation syntax to define a Lambda function.

AWS::Serverless::Function是用于定义Lambda函数的AWS SAM语法,在执行AWS SAM时,该Lambda函数根据约定在Cloudformation(AWS::Lambda::Function)和相关资源中内部创建Lambda函数.

AWS::Serverless::Function is the AWS SAM syntax to define a Lambda function which internally creates a Lambda function in Cloudformation (AWS::Lambda::Function) and related resources by convention when executing AWS SAM.

这篇关于无服务器功能和Lambda函数有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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