portkey

Portkey: from REPL to Serverless in one call
viesti 2017-09-05T04:44:06.000107Z

so what I figure is that with :postwe would pass parsed json from API Gateway (have not yet figured out other content types, binary is nowadays an option too) into a single-arity mounted function

viesti 2017-09-05T04:44:34.000123Z

what api gw gives lookes like this now:

Mon Sep 04 19:57:03 UTC 2017 : Endpoint request body after transformations: {
“body-json” : {“a”:1},
“params” : {
“path” : {
    }
    ,“querystring” : {
    }
    ,“header” : {
    }
    },
“stage-variables” : {
},
“context” : {
    “account-id” : “262355063596",
    “api-id” : “04d57u6034",
    “api-key” : “test-invoke-api-key”,
    “authorizer-principal-id” : “”,
    “caller” : “262355063596",
    “cognito-authentication-provider” : “”,
    “cognito-authentication-type” : “”,
    “cognito-identity-id” : “”,
    “cognito-identity-pool-id” : “”,
    “http-method” : “POST”,
    “stage” : “test-invoke-stage”,
    “source-ip” : “test-invoke-source-ip”,
    “user” : “262355063596",
    “user-agent” : “Apache-HttpClient/4.5.x (Java/1.8.0_131)“,
    “user-arn” : “arn:aws:iam::262355063596:root”,
    “request-id” : “test-invoke-request”,
    “resource-id” : “2jmogc”,
    “resource-path” : “/h”
    }
}

viesti 2017-09-05T04:52:12.000040Z

aiming for post with json body for now

cgrand 2017-09-05T08:15:47.000278Z

then one could the JSON to a Ring Request map

viesti 2017-09-05T08:43:59.000347Z

yup

viesti 2017-09-05T08:45:15.000139Z

would like to do smallest amount of velocity template as possible :)

viesti 2017-09-05T08:53:50.000166Z

hmm, how does proxy appear in swagger?

cgrand 2017-09-05T09:07:12.000122Z

I’m not sure that there would still be some swagger

viesti 2017-09-05T09:07:16.000167Z

ring request/response map would anyway make talking to api gw a bit more consistent and familiar

viesti 2017-09-05T09:07:51.000286Z

hum, thinking that where would the route be configured

cgrand 2017-09-05T09:09:50.000309Z

/{all-paths-are-belong-to-me+} https://aws.amazon.com/blogs/aws/api-gateway-update-new-features-simplify-api-development/

cgrand 2017-09-05T09:11:05.000200Z

basically we could have API GW to mostly work as a reverse proxy

viesti 2017-09-05T09:11:10.000023Z

> Lambda Function Integration – A new default mapping template will send the entire request to your Lambda function and then turn the return value into an HTTP response.

viesti 2017-09-05T09:11:13.000221Z

yes that is the intention

viesti 2017-09-05T09:11:40.000193Z

that quote leads me to think that there is still some Velocity thing in between

viesti 2017-09-05T09:12:43.000233Z

anyway, looks like a path to take

viesti 2017-09-05T09:15:12.000276Z

if there is swagger, it’s minimal

cgrand 2017-09-05T09:15:19.000005Z

and constant

viesti 2017-09-05T13:28:32.000092Z

on Zappa and over 50MB lambda https://github.com/Miserlou/Zappa/blob/master/README.md#large-projects

cgrand 2017-09-05T13:37:40.000418Z

thanks, that’s somehow what I imagined

viesti 2017-09-05T13:48:29.000233Z

Zappa has progress bar, hrm

viesti 2017-09-05T13:48:40.000133Z

looking at Readme

viesti 2017-09-05T13:48:54.000563Z

~5MB minimal lambda

viesti 2017-09-05T13:49:11.000012Z

hmm, why so large...

viesti 2017-09-05T13:50:30.000695Z

> Zappa makes it super easy to build and deploy all Python WSGI applications on AWS Lambda + API Gateway.

viesti 2017-09-05T13:50:46.000633Z

they go for the ring equivalent of Python

viesti 2017-09-05T14:09:44.000681Z

one for Clojure but lacks ease of use https://github.com/jpb/ring-aws-lambda-adapter

viesti 2017-09-05T14:10:56.000250Z

we should hack away the AWS API so that there is a feeling that the user owns AWS, not the other way around :)

👍 1
viesti 2017-09-05T15:51:05.000414Z

how didn't I spot this earlier

cgrand 2017-09-05T19:09:26.000451Z

My thoughts exactly: let's put the user in control.