portkey

Portkey: from REPL to Serverless in one call
viesti 2018-03-27T14:38:15.000838Z

hmm, put up a branch for reading models from a maven artifact

viesti 2018-03-27T14:38:36.000476Z

thinkin that could merge it to master

viesti 2018-03-27T14:53:57.000117Z

hmm, not, missed how src/portkey/aws/lambda.clj is generated

viesti 2018-03-27T14:59:10.000787Z

ah, missed this if:

(if version
                          [(java.io.File. (str “src/portkey/aws/” apifile “/_” version “.clj”))
                           (symbol (str “portkey.aws.” apins “.-” version))]
                          [(java.io.File. (str “src/portkey/aws/” apifile “.clj”))
                           (symbol (str “portkey.aws.” apins))])

viesti 2018-03-27T15:01:49.000614Z

there's only one version in aws-java-sdk-models

viesti 2018-03-27T15:08:37.000894Z

why I got here was that wanted to create lambda with current max memory limit (3008MB) :)

cgrand 2018-03-27T15:09:51.000226Z

does it work?

viesti 2018-03-27T15:21:07.000868Z

nearly there

viesti 2018-03-27T15:22:37.000218Z

user=> (lambda/create-function {:function-name “testing” :runtime “java8" :handler “com.example.myapp” :memory-size 3008 :role “arn:aws:iam::262355063596:role/portkey” :code {:s3-bucket “tiuhti-portkey” :s3-key “myapp.zip”}})
{:role “arn:aws:iam::262355063596:role/portkey”, :description “”, :revision-id “52694660-d403-4999-a8e6-564f0e5cf1ff”, :code-size 4373063, :function-arn “arn:aws:lambda:eu-west-1:262355063596:function:testing”, :dead-letter-config {}, :master-arn nil, :last-modified “2018-03-27T15:22:22.200+0000”, :code-sha256 “V+BmqCrzvIiu0RfCbNqMWwKHN0ZM3J8FgHUve+9OnL8=“, :runtime :java8, :memory-size 3008, :vpc-config {}, :environment {}, :tracing-config {:mode :pass-through}, :timeout 3, :version “$LATEST”, :kmskey-arn nil, :handler “com.example.myapp”, :function-name “testing”}

viesti 2018-03-27T15:22:40.000637Z

success!

viesti 2018-03-27T15:25:31.000492Z

have to learn more git magic to clean my working copy from generated files

2018-03-27T15:25:54.000008Z

viesti 2018-03-27T15:26:05.000738Z

while working on the generator, that is

viesti 2018-03-27T15:26:19.000023Z

succesfull run brings only new stuff working stuff

viesti 2018-03-27T15:26:35.000873Z

added lein gen-aws-api alias

viesti 2018-03-27T15:27:38.000222Z

many new API’s and changes to existing ones

viesti 2018-03-27T15:29:12.000334Z

30 new APIs since the last check?

viesti 2018-03-27T15:29:43.000869Z

reInvent happened between september and now

cgrand 2018-03-27T15:30:10.000798Z

let’s hope they didn’t introduce new protocols

😅 1
viesti 2018-03-27T15:30:28.000766Z

hmm, might be that new APIs not fully generated

viesti 2018-03-27T15:30:42.000275Z

Encountered 8 errors while generating, failed for APIs: serverlessrepo, runtime.lex, apigateway, mq, medialive, mediaconvert, guardduty, mediapackage

viesti 2018-03-27T15:31:32.000443Z

should probably remove a file that encountered exception while printing to it

cgrand 2018-03-27T15:32:21.000532Z

a pure program doesn’t even create files

viesti 2018-03-27T15:32:38.000601Z

we need heat here up north

viesti 2018-03-27T15:34:46.000609Z

portkey isn’t as hot as bitcoin mining though

cgrand 2018-03-27T15:35:27.000152Z

🙂 you know your classics

viesti 2018-03-27T15:37:46.000527Z

learning 🙂

2018-03-27T15:39:13.000711Z

viesti 2018-03-27T15:40:44.000238Z

realising that gen-aws-api might remove existing API’s

viesti 2018-03-27T15:41:06.000595Z

deleted: src/portkey/aws/apigateway.clj

viesti 2018-03-27T15:41:20.000856Z

hmm

cgrand 2018-03-27T15:41:21.000819Z

no one uses that!

viesti 2018-03-27T15:41:25.000067Z

😄

viesti 2018-03-27T15:41:33.000842Z

apigateway? really? 🙂

viesti 2018-03-27T15:41:47.000508Z

might keep the old one

viesti 2018-03-27T15:42:28.000914Z

well or just git not choose it

2018-03-27T15:45:15.000595Z

viesti 2018-03-27T15:45:17.000194Z

but off to the heat of sauna

cgrand 2018-03-27T15:45:43.000207Z

bitcoin-heated sauna?

viesti 2018-03-27T16:33:06.000006Z

just traditional dumb heat for now

dominicm 2018-03-27T17:01:09.000566Z

A sauna sounds nice...

viesti 2018-03-27T17:14:02.000408Z

it’s Finnish tradition to have one in every house

viesti 2018-03-27T17:34:21.000562Z

user=> (require '[portkey.aws.apigateway :as apigw])
nil
user=> (apigw/get-rest-apis)
{:items [{:created-date "2017-07-25T19:45:52Z", :id "04d57u6034", :name "portkey", :version "2018-03-23T19:15:08+02"} {:created-date "2017-10-01T17:12:42Z", :id "4jhj5avwn7", :name "lol", :version "2017-10-01T20:16:19+03"}]}

2018-03-27T17:35:40.000736Z

2018-03-27T17:35:42.000345Z

2018-03-27T17:36:13.000206Z