通过http请求调用AWS Lambda函数 [英] Invoke a AWS Lambda function by a http request

查看:345
本文介绍了通过http请求调用AWS Lambda函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过http请求(GET或POST)直接调用AWS Lambda函数?如果不是,是否有通过SNS或S3的解决方法?因为我想不起来...

Is it possible to invoke a AWS Lambda function directly by a http request (either GET or POST)? If not, is there a workaround going through SNS or S3? Because I can't think of one...

具体来说,我想使用JSON创建一个小型API

Specifically, I would like to create a small API using JSON

推荐答案

AWS API网关是通过HTTP公开lambda函数的唯一方法.如果在创建新的lambda函数时使用microservice-http-endpoint蓝图,则AWS lambda Web控制台应自动为您创建一个.

The AWS API Gateway is the only way to expose your lambda function over HTTP. The AWS lambda web console should create one automatically for you if you use the microservice-http-endpoint blueprint when creating a new lambda function.

或者您可以从以下屏幕进行设置

Or you can set it from the following screen

或从AWS API Gateway Web控制台创建它.

Or create it from the AWS API Gateway web console.

您还可以探索在客户端,移动或网络应用程序中使用SDK来按需调用它.详细信息此处.

You may also explore invoking it on demand using the SDK in your client, mobile or web app. More information here.

这篇关于通过http请求调用AWS Lambda函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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