amazon web services - API Gateway - Lambda proxy integration and asynchronous call -
if set header x-amz-invocation-type: 'event', call done asynchronously amazon documentation states (https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html#api-gateway-simple-proxy-for-lambda-output-format), when 1 uses proxy lambda integration, lambda function must return formatted response of kind:
callback(null, {"statuscode": 200, "body": "results"}) as lambda function called asynchronously, api gateway never answer , return 502 bad gateway error instead of 200 ok status.
below extract of swagger configuration:
"/myfunc": { "post": { "parameters": [ { "name": "myparam", "in": "query", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response" } }, "x-amazon-apigateway-request-validator": "validate query string parameters , headers", "x-amazon-apigateway-integration": { "responses": { "default": { "statuscode": "200" } }, "uri": "arn:aws:apigateway:ap-northeast-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ap-northeast-1:idaccount:function:myfunc/invocations", "passthroughbehavior": "when_no_match", "httpmethod": "post", "type": "aws_proxy", "requestparameters": { "integration.request.header.x-amz-invocation-type": "'event'" } } } } is there way have worked?
Comments
Post a Comment