First of all, I'm new to overall AWS. I am trying to solve a problem using AWS lambda and API gateway.
string
def lambda_function(event, context): if event['some_property']: return "SUCCESS: Operation performed successfully." else return "ERROR: Operation failed."
In triggers, I configured the gateway API.
In the API gateway service for the created resource, the integration request is configured to go to the lambda function. I checked the lambda function and it returns the values correctly.
But if I twist the API by creating a mail request, it returns a server error. This is a message.
{"message": "internal server error"}
application/json
, Integration Response -. 200 , .
200
Lambda -. . http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-as-simple-proxy-for-lambda.html
, . , , "Petstore API", , . . " API".
statusCode Lambda. , API- 502 Bad Gateway.
statusCode
502 Bad Gateway
message = { 'message': 'Execution started successfully!' } return { 'statusCode': 200, 'headers': {'Content-Type': 'application/json'}, 'body': json.dumps(message) }
P.S. , . , -!
Source: https://habr.com/ru/post/1663526/More articles:PHP Factory Methods - phpUnable to read property "nodeModulesPath" from undefined - EMBER - node.jsIs there a way to add a Docker host to the / etc / hosts container using docker-compose? - dockerUnable to read "navigate" property from undefined in angular2 component function - angularReading a value from a dynamically created button in Javascript / HTML - javascriptPull an image using Docker on Windows 10: "Failed to register layer .... Denied access" - dockerThe test kitchen does not try to restart on the 2012R2 server - chef-recipeHow can I specify a parameter for POST requests when using APIView with django-rest-swagger - djangoGoogle Flexible Environment Deploy Fail "Ошибка запуска приложения" - google-app-enginein android google vision OCR, how can I determine recognition accuracy - androidAll Articles