aws-api-gateway

AWS lambda api gateway error “Malformed Lambda proxy response”

随声附和 提交于 2019-11-26 08:19:59
问题 I am trying to set up a hello world example with AWS lambda and serving it through api gateway. I clicked the \"Create a Lambda Function\", which set up the api gatway and selected the Blank Function option. I added the lambda function found on AWS gateway getting started guide: exports.handler = function(event, context, callback) { callback(null, {\"Hello\":\"World\"}); // SUCCESS with message }; The issue is that when I make a GET request to it, it\'s returning back a 502 response { \

AWS API Gateway base64Decode produces garbled binary?

僤鯓⒐⒋嵵緔 提交于 2019-11-26 08:13:32
问题 I\'m trying to return a 1px gif from an AWS API Gateway method. Since binary data is now supported, I return an image/gif using the following \'Integration Response\' mapping: $util.base64Decode(\"R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\") However, when I look at this in Chrome, I see the following binary being returned: Instead of: Could anyone help me understand why this is garbled and the wrong length? Or what I could do to return the correct binary? Is there some other

Can an AWS Lambda function call another

我只是一个虾纸丫 提交于 2019-11-26 02:03:27
问题 I have 2 Lambda functions - one that produces a quote and one that turns a quote into an order. I\'d like the Order lambda function to call the Quote function to regenerate the quote, rather than just receive it from an untrusted client. I\'ve looked everywhere I can think of - but can\'t see how I\'d go about chaining or calling the functions...surely this exists! 回答1: I found a way using the aws-sdk . var aws = require('aws-sdk'); var lambda = new aws.Lambda({ region: 'us-west-2' //change

How to pass a querystring or route parameter to AWS Lambda from Amazon API Gateway

故事扮演 提交于 2019-11-26 00:45:14
问题 for instance if we want to use GET /user?name=bob or GET /user/bob How would you pass both of these examples as a parameter to the Lambda function? I saw something about setting a \"mapped from\" in the documentation, but I can\'t find that setting in the API Gateway console. method.request.path.parameter-name for a path parameter named parameter-name as defined in the Method Request page. method.request.querystring.parameter-name for a query string parameter named parameter-name as defined

How to pass a querystring or route parameter to AWS Lambda from Amazon API Gateway

血红的双手。 提交于 2019-11-25 23:26:09
for instance if we want to use GET /user?name=bob or GET /user/bob How would you pass both of these examples as a parameter to the Lambda function? I saw something about setting a "mapped from" in the documentation, but I can't find that setting in the API Gateway console. method.request.path.parameter-name for a path parameter named parameter-name as defined in the Method Request page. method.request.querystring.parameter-name for a query string parameter named parameter-name as defined in the Method Request page. I don't see either of these options even though I defined a query string. As of