Fork me on GitHub
#portkey
<
2017-09-05
>
viesti04:09:06

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

viesti04:09:34

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”
    }
}

viesti04:09:12

aiming for post with json body for now

cgrand08:09:47

then one could the JSON to a Ring Request map

viesti08:09:15

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

viesti08:09:50

hmm, how does proxy appear in swagger?

cgrand09:09:12

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

viesti09:09:16

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

viesti09:09:51

hum, thinking that where would the route be configured

cgrand09:09:05

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

viesti09:09:10

> 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.

viesti09:09:13

yes that is the intention

viesti09:09:40

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

viesti09:09:43

anyway, looks like a path to take

viesti09:09:12

if there is swagger, it’s minimal

cgrand09:09:19

and constant

cgrand13:09:40

thanks, that’s somehow what I imagined

viesti13:09:29

Zappa has progress bar, hrm

viesti13:09:40

looking at Readme

viesti13:09:54

~5MB minimal lambda

viesti13:09:11

hmm, why so large...

viesti13:09:30

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

viesti13:09:46

they go for the ring equivalent of Python

viesti14:09:56

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

viesti15:09:05

how didn't I spot this earlier

cgrand19:09:26

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