so what I figure is that with :post
we 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
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”
}
}
aiming for post with json body for now
hmmm, what about Lambda Proxy Integration + ANY? http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-as-simple-proxy-for-lambda.html#api-gateway-proxy-integration-lambda-function-java
then one could the JSON to a Ring Request map
yup
would like to do smallest amount of velocity template as possible :)
hmm, how does proxy appear in swagger?
I’m not sure that there would still be some swagger
ring request/response map would anyway make talking to api gw a bit more consistent and familiar
hum, thinking that where would the route be configured
/{all-paths-are-belong-to-me+}
https://aws.amazon.com/blogs/aws/api-gateway-update-new-features-simplify-api-development/
basically we could have API GW to mostly work as a reverse proxy
> 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.
yes that is the intention
that quote leads me to think that there is still some Velocity thing in between
anyway, looks like a path to take
if there is swagger, it’s minimal
and constant
on Zappa and over 50MB lambda https://github.com/Miserlou/Zappa/blob/master/README.md#large-projects
thanks, that’s somehow what I imagined
Zappa has progress bar, hrm
looking at Readme
~5MB minimal lambda
hmm, why so large...
> Zappa makes it super easy to build and deploy all Python WSGI applications on AWS Lambda + API Gateway.
they go for the ring equivalent of Python
one for Clojure but lacks ease of use https://github.com/jpb/ring-aws-lambda-adapter
we should hack away the AWS API so that there is a feeling that the user owns AWS, not the other way around :)
how didn't I spot this earlier
My thoughts exactly: let's put the user in control.