【发布时间】:2017-05-28 22:40:31
【问题描述】:
我在 swagger 中收到“服务器无响应”错误,lambda 函数也没有触发,我在 cloudwatch 中没有看到任何错误,好像我在 post 方法中遇到了 YAML 文件的问题。 我花了 2 天时间试图了解这里发生了什么,但没有任何结果,所以我将不胜感激! 我的 yaml 文件:
pool-config:
handler: dest/functions/pool-config/handler.execute
events:
- http:
path: v1/config/pool
method: post
integration: lambda
request:
template:
application/json: '{
"body": "$input.json(''$'')",
"functionAlias": "$stageVariables.functionAlias",
"principalId": "$context.authorizer.principalId",
"httpMethod": "$context.httpMethod"}'
response:
headers:
Content-Type: "'application/json'"
Access-Control-Allow-Origin: "'*'"
template: $input.path('$')
cors:
origins:
- '*'
headers:
- Content-Type
- X-Amz-Date
- Authorization
authorizer: authorizer
【问题讨论】:
标签: amazon-web-services yaml aws-lambda