aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
orestis 2019-05-15T07:04:44.052200Z

Iā€™d like to use SQS for a low-traffic mail-sending queue (say less than 5k emails/day), but both the producers and the consumers would not be running on AWS (yet, they will in 6 months time). Is this a crazy idea or pretty normal?

ghadi 2019-05-15T12:28:09.052500Z

Normal @orestis

orestis 2019-05-15T12:37:15.053500Z

Cool! I see that they say latency is at most low hundred ms so for an email queue that sounds acceptable.

kenny 2019-05-15T17:09:48.053900Z

What are valid blob types I can pass to aws-api?

kenny 2019-05-15T17:12:19.054100Z

Ah, the specs are useful šŸ™‚

kenny 2019-05-15T17:12:21.054400Z

(s/form :cognitect.aws.s3.PutObjectRequest/Body)
=>
(clojure.spec.alpha/or
 :byte-array
 clojure.core/bytes?
 :input-stream
 (clojure.core/fn [%] (clojure.core/instance? java.io.InputStream %)))

ghadi 2019-05-15T17:12:55.054700Z

we might expand that in the future

ghadi 2019-05-15T17:13:09.055Z

specifically to handle larger than memory objects

1
kenny 2019-05-15T17:14:30.055900Z

If my :PutObject request fails, does aws-api automatically retry the request?

kenny 2019-05-15T17:16:32.056400Z

Ah I see - it's set on the client and, optionally, on the individual request. Nice.

kenny 2019-05-15T17:19:43.056800Z

Has it been considered to have the client implement Closable?

kenny 2019-05-15T17:24:43.057100Z

Also could a client? function be added?

ghadi 2019-05-15T17:25:07.057300Z

why the predicate?

kenny 2019-05-15T17:25:15.057500Z

Spec

kenny 2019-05-15T17:25:34.057800Z

i.e. right now I need to do this:

(s/def ::s3-client #(satisfies? aws-client/ClientSPI %))

kenny 2019-05-15T19:29:28.058400Z

Out of curiosity, does anyone know if Azure or GCP expose their APIs via data files like AWS does?

kenny 2019-05-15T19:38:26.059300Z

Looks like they do provide swagger JSON files for all their APIs.

kenny 2019-05-15T19:42:17.060100Z

If you could transform the AWS API JSONs into the OpenAPI format, it seems like the aws-api concept could work for multiple cloud providers.

kenny 2019-05-15T19:43:53.060400Z

Looks like someone has already done this: https://github.com/APIs-guru/openapi-directory/tree/master/APIs/amazonaws.com

ghadi 2019-05-15T19:44:42.060900Z

there's a lot of little exceptions to the AWS APIs

kenny 2019-05-15T19:45:35.061600Z

Kinda figured. Know any examples offhand?

ghadi 2019-05-15T19:47:32.062Z

almost all of s3

ghadi 2019-05-15T19:47:48.062400Z

some apis require extra headers with md5 of body

ghadi 2019-05-15T19:48:09.063Z

S3 is the "weird API"

kenny 2019-05-15T19:48:11.063100Z

Oh, that stuff can't be documented with openapi?

ghadi 2019-05-15T19:48:24.063400Z

dunno

ghadi 2019-05-15T19:48:43.063900Z

it's not in the amazon descriptors, so it wouldn't be in any translation of those descriptors

kenny 2019-05-15T19:49:49.064300Z

How does aws-api handle it?

ghadi 2019-05-15T19:50:12.064600Z

special code that runs on particular requests

ghadi 2019-05-15T19:50:29.065Z

there's an private extension point through a multimethod

kenny 2019-05-15T19:51:03.065600Z

Ah. You don't think you'd be able to do the same thing with multiple cloud providers?

ghadi 2019-05-15T19:52:06.066200Z

sure. I'm just trying to say that json descriptors isn't enough for at least AWS

ghadi 2019-05-15T19:52:22.066800Z

there's particular API domain knowledge necessary, unfortunately

ghadi 2019-05-15T19:52:41.067300Z

you may want to look at official GCP client sdks and look for these exceptional cases

ghadi 2019-05-15T19:53:01.067700Z

searching for interceptors, request transformers, stuff like that

kenny 2019-05-15T19:54:10.068200Z

It seems like you'd be able to handle that in a similar manner to how aws-api handles "special" apis

ghadi 2019-05-15T19:54:25.068400Z

yup

kenny 2019-05-15T19:57:14.070800Z

Interesting. My company is adding support for additional cloud providers and we really enjoy working with aws-api. Any thoughts on how difficult it'd be to change aws-api to take in OpenAPI JSON instead of the aws-specific JSON files?

ghadi 2019-05-15T19:58:38.072300Z

personally I wouldn't try to modify, but I'd take the same approach. input = descriptors -> output = functions that can assemble and disassemble request/response maps

ghadi 2019-05-15T19:59:39.072900Z

then you wire the functions with an HTTP client

kenny 2019-05-15T20:00:22.073300Z

Too many things coupled to aws in aws-api to try and modify it?

ghadi 2019-05-15T20:02:05.074100Z

the descriptor transforming code isn't open source

kenny 2019-05-15T20:03:53.074900Z

Oh really? Is that non-trivial to do?

ghadi 2019-05-15T20:04:13.075300Z

but mainly I wouldn't try to modify the client because it's conceptually a simple thing

ghadi 2019-05-15T20:04:24.075600Z

you get descriptors from google, and you shred them into functions

ghadi 2019-05-15T20:04:39.075800Z

functions that operate on maps

ghadi 2019-05-15T20:04:51.076200Z

I'm doing something similar with a native protocol buffer client

kenny 2019-05-15T20:05:08.076900Z

Right. The main thing that will differ, I think, is the authentication.

ghadi 2019-05-15T20:05:19.077200Z

something that takes .proto files and builds functions from maps -> bytes and bytes -> maps

kenny 2019-05-15T20:16:20.078500Z

It almost seems like this version of aws-api that is cloud provider independent is simply an OpenAPI HTTP client.

ghadi 2019-05-15T20:16:50.078700Z

i don't follow

kenny 2019-05-15T20:21:07.080300Z

You could write a library that exposes any OpenAPI spec'ed API in the same format that aws-api takes.