08/19/2020, 4:42 PM
Anyone know how, or where to override the
property on API Gateways? I’m trying to make it
, but not sure where to pass that in since the
takes a
aws.lambda.EventHandler<Request, Response>
, but I’m not sure how to pass those arguments along to the API when its pointing to a new `aws.lambda.CallbackFunction`… Thanks in advance.
This one is very frustrating, since AWS api gateway by default seems to be setting base64 encoding to true by default, and expects params for POSTs also. Not sure if i’m more frustrated with the awsx sdk, pulumi, or api gateway on this one. but this shouldn’t be so difficult to override arguments like it is in this particular case.


08/20/2020, 8:22 AM
Yeah I've found that some of the nooks and crannies are pretty inflexible for awsx since it's more of an extension library. Is decoding the event.body an option?
maybe something like this in your lambda
let payloadString = event.body;
  if (event.isBase64Encoded) {
    // Decode base64 encoded string
    payloadString = Buffer.from(payloadString, 'base64').toString('binary');
  // Parse payload string into an object
  const payload = JSON.parse(payloadString);
It doesn't get override the property, but at least it makes the encoded event.body usable
👍 1


08/20/2020, 3:13 PM
yeah, basically have to do what you suggest with the buffer… thx for the response. otherwise, there are mapping templates that can be used also, but haven’t looked into that at all.