当我尝试使用AWS CloudFormation创建与Lambda函数集成的API Gateway-> GET方法时,出现错误:CREATE_FAILED AWS::ApiGateway::Resource [my resource] Unable to parse HTTP response content

任何的想法 ?!

最佳答案

在指定MethodResponses时,必须使用强制来包含状态代码。

这将失败并显示“无法解析”:

"MethodResponses": [{
  "ResponseModels": {
    "application/json": { "Ref": "myModel" }
} } ],

这将成功:
"MethodResponses": [{
  "ResponseModels": {
    "application/json": { "Ref": "myModel" }
  },
  "StatusCode": 200
} ],

不,the documentation没有这么说。也没有给出示例。

08-07 11:26