在不使用API​​网关和EC2实例的情况下调用aws Lambda函数 [英] Call aws Lambda function without using API Gateway and EC2 Instance

查看:106
本文介绍了在不使用API​​网关和EC2实例的情况下调用aws Lambda函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在不使用API​​网关的情况下从外部AWS调用lambda函数吗?我想直接从外部AWS服务调用lambda函数吗?

Can we call lambda function from outside aws without using API Gateway? I want to call lambda function directly from outside aws services is it possible?

推荐答案

可以通过以下方式触发AWS Lambda函数:

AWS Lambda functions can be triggered by:

  • 其他AWS服务上发生的事件(例如,对象上传到Amazon S3存储桶)
  • 正在发送到AWS API Gateway的消息(例如REST调用)
  • Amazon CloudWatch Events中的时间表
  • 直接API调用
  • Events happening on other AWS services (eg Object uploaded to an Amazon S3 bucket)
  • A message being sent to AWS API Gateway (eg a REST call)
  • A schedule in Amazon CloudWatch Events
  • A direct API call

来自受支持的事件源文档:

除了使用事件源调用Lambda函数外,您还可以根据需要调用Lambda函数.在这种情况下,您不需要预先配置任何事件源映射.但是,请确保自定义应用程序具有调用Lambda函数的必要权限.

In addition to invoking Lambda functions using event sources, you can also invoke your Lambda function on demand. You don't need to preconfigure any event source mapping in this case. However, make sure that the custom application has the necessary permissions to invoke your Lambda function.

例如,用户应用程序还可以生成事件(构建您自己的自定义事件源).客户端,移动或Web应用程序之类的用户应用程序可以使用AWS开发工具包或AWS移动SDK(例如适用于Android的AWS移动SDK)发布事件并调用Lambda函数.

For example, user applications can also generate events (build your own custom event sources). User applications such as client, mobile, or web applications can publish events and invoke Lambda functions using the AWS SDKs or AWS Mobile SDKs such as the AWS Mobile SDK for Android.

因此,Internet上的任何东西都可以调用Lambda函数,但是它将需要使用AWS凭证进行身份验证.

So, anything on the Internet can invoke a Lambda function, but it will need to use AWS credentials to authenticate.

这篇关于在不使用API​​网关和EC2实例的情况下调用aws Lambda函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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