portkey

Portkey: from REPL to Serverless in one call
viesti 2017-09-06T06:12:57.000008Z

in a way that doesn’t end up into “Why I have to do all of this” 🙂

tatut 2017-09-06T07:47:49.000184Z

is aws-clj-sdk in a usable state? are there codox generated docs available

cgrand 2017-09-06T08:59:28.000332Z

no & no

cgrand 2017-09-06T09:00:02.000560Z

yesterday I got the 1st api call through but haven’t pushed yet and most APIs are not generated yett

cgrand 2017-09-06T09:00:38.000104Z

and I haven’t inlined docs yet

tatut 2017-09-06T09:09:26.000164Z

so, soon… how can I help?

viesti 2017-09-06T09:10:56.000242Z

oops, meant for private chat 🙂

viesti 2017-09-06T09:10:58.000057Z

err 🙂

viesti 2017-09-06T09:11:08.000267Z

hmm well

viesti 2017-09-06T09:12:13.000423Z

apropos, what about the post support for portkey, I guess we’d need that for the demo next week

cgrand 2017-09-06T09:12:49.000359Z

no you need it 😉

cgrand 2017-09-06T09:15:31.000204Z

@viesti what’s the current state of your work towards POST? any blockers or doubt?

viesti 2017-09-06T09:16:42.000074Z

blocked but saw some light yesterday while watching basketball (long story)

viesti 2017-09-06T09:17:52.000149Z

if I have time to try the proxy approach I think that at first I’d make it work by passing :get params to function as now

viesti 2017-09-06T09:18:05.000152Z

then passing single input param for :post

viesti 2017-09-06T09:18:11.000052Z

don’t yet have idea for ring

cgrand 2017-09-06T09:20:09.000219Z

@tatut a required task which is independent enough is: computing the endpoint. Data live there https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/resources/com/amazonaws/partitions/endpoints.json (missing from the repo at the moment) and mimicking aws-sdk-java logic would be a good start

cgrand 2017-09-06T09:21:09.000356Z

@viesti get the proxy to work and I’ll guide you with ring

viesti 2017-09-06T09:21:15.000091Z

yes

tatut 2017-09-06T09:24:33.000044Z

I’ll try it out some day, the endpoint seems straight forward, but don’t hold your breath

cgrand 2017-09-07T12:32:53.000199Z

I’ve done it

viesti 2017-09-06T09:36:40.000085Z

> AWS_DEFAULT_REGION – AWS region. This variable overrides the default region of the in-use profile, if set.

viesti 2017-09-06T09:38:19.000387Z

and profiles are in ~/.aws/credentials, say region=eu-west-1 under the ini file sections, from which [default] is used by default if present, otherwise one that matches AWS_PROFILE environment variable if present

cgrand 2017-09-06T09:58:47.000208Z

compat with env & credentials would be great

tatut 2017-09-06T10:02:02.000281Z

route53 seems to be rest-xml, not rest-json so defapi fails for it, in my test

viesti 2017-09-06T10:09:53.000282Z

the xml age

cgrand 2017-09-06T10:18:05.000080Z

I even have removed defapi locally

cgrand 2017-09-06T10:19:49.000073Z

but yeah focusing on rest-json atm

cgrand 2017-09-06T10:19:55.000332Z

one protocol after the other

viesti 2017-09-06T10:41:40.000202Z

:portkey:

1
cgrand 2017-09-06T10:42:06.000070Z

nice

cgrand 2017-09-06T11:21:16.000024Z

totally untested but generation of rest-json api is ok

cgrand 2017-09-06T11:26:09.000180Z

oh and all endpoints are wrong since hardcoded to lambda/frankfurt

cgrand 2017-09-06T11:26:42.000356Z

anyway it looks like this https://github.com/portkey-cloud/aws-clj-sdk/blob/master/src/portkey/aws/lambda.clj

cgrand 2017-09-06T13:29:27.000269Z

Step #4 and #5 sounds complex to emulate http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html

cgrand 2017-09-06T14:07:22.000330Z

Step #4 is not that hard: From inside the container, you can query the credentials with the following command: Copy [ec2-user ~]$ curl 169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI Output: { “AccessKeyId”: “ACCESS_KEY_ID”, “Expiration”: “EXPIRATION_DATE”, “RoleArn”: “TASK_ROLE_ARN”, “SecretAccessKey”: “SECRET_ACCESS_KEY”, “Token”: “SECURITY_TOKEN_STRING” }