Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Unable to parse HTTP response content" when creating ApiGateway::Resource

When I tried to create API Gateway-> GET method with integration to Lambda function using AWS CloudFormation, I'm getting error:
CREATE_FAILED AWS::ApiGateway::Resource [my resource] Unable to parse HTTP response content.

Any idea ?!

like image 474
user2388553 Avatar asked Nov 09 '22 15:11

user2388553


1 Answers

When specifying the MethodResponses, it's mandatory to include the status code.

This will fail with "unable to parse":

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

And this will succeed:

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

No, the documentation doesn't say this. Nor does it give an example.

like image 171
tedder42 Avatar answered Nov 14 '22 21:11

tedder42