作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
.net核心无服务器Web API
我正在尝试与lambda和api网关进行代理集成,而AWS控制台一切正常
但是我面对aws cli命令的问题
我尝试与cli集成,但lambda未正确集成
aws apigateway create-resource --rest-api-id id --parent-id id --path-part {proxy+}
aws apigateway put-method --rest-api-id id --resource-id id --http-method ANY --authorization-type "NONE"
aws apigateway put-integration --rest-api-id id --resource-id id --http-method ANY --type HTTP_PROXY --integration-http-method ANY --uri arn:aws:apigateway:us-east-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-east-2:account_id:function:helloworld/invocations
aws lambda add-permission --function-name helloworld --action lambda:InvokeFunction --principal apigateway.amazonaws.com --source-arn arn:aws:execute-api:us-east-2:account_id:apiid/*/*/* --statement-id 12345678
最佳答案
This article列出了在具有Lambda代理集成的AWS API Gateway上创建简单的/ping
API的所有步骤。
具体来说,您的命令有两个问题-
不正确的
aws apigateway create-resource --rest-api-id id --parent-id id --path-part {proxy+}
aws apigateway create-resource --rest-api-id id --parent-id id --path-part "{proxy+}"
aws apigateway put-integration \
--rest-api-id id \
--resource-id id \
--http-method ANY \
--type HTTP_PROXY \
--integration-http-method ANY \
--uri arn:aws:apigateway:us-east-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-east-2:account_id:function:helloworld/invocations
aws apigateway put-integration \
--rest-api-id id \
--resource-id id \
--http-method ANY \
--type AWS_PROXY \
--integration-http-method POST \
--uri arn:aws:apigateway:us-east-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-east-2:account_id:function:helloworld/invocations
关于amazon-web-services - 具有ID的API不包含路径/*的资源,该资源的ANY方法具有集成LAMBDA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56567101/
我是一名优秀的程序员,十分优秀!