aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
stuarthalloway 2021-01-04T12:24:25.240700Z

@borkdude is there a way to repro the http-client reflection warning on the JVM? I am happy to fix it but don't see a warning when loading the namespace (from Java 11).

borkdude 2021-01-04T12:43:04.242600Z

@stuarthalloway After closer inspection, I think the warning came from using import java.lang.reflect.Array;. This is the warning I got from graalvm:

"Class java.nio.HeapByteBuffer[] is instantiated reflectively but was never registered. Register the class by using org.graalvm.nativeimage.hosted.RuntimeReflection"
from around line 108 in the cognitect.http-client namespace and this config fixed it for me (using a reflection.json config file):
[
  {"name": "[Ljava.nio.HeapByteBuffer;"}
]
So it's no longer a problem for me and probably not something that can be fixed without avoiding reflect.Array, which is used by into-array (although it's the first time I encountered this specific problem with into-array). Thanks for looking into it and sorry for taking up your time.

stuarthalloway 2021-01-04T13:07:26.244400Z

@borkdude Thanks for all you are doing exploring that is possible with GraalVM. I don't use it for day job stuff (yet?), but if there is low hanging fruit happy to help grab it.

2👍3❤️
borkdude 2021-01-04T13:11:50.245900Z

Good to hear. For context, we are working on a babashka aws pod (which wraps aws-api), which runs natively, so you can use aws-api in scripts without a JVM with very fast startup time.

1🆒1👀
borkdude 2021-01-04T13:16:18.246100Z

Babashka pods are basically CLIs but they expose their data through EDN or Transit (or JSON) and can be called using normal functions instead of shelling out, RPC-style.

stuarthalloway 2021-01-04T13:28:47.246600Z

that sounds terrific

borkdude 2021-01-04T13:29:46.246800Z

This is a list of existing pods that can already be used from babashka: https://github.com/babashka/pod-registry A few of them are written in Clojure and compiled with GraalVM native-image.

lukasz 2021-01-04T19:32:50.248400Z

Any idea how to pass x-aws-acl header in the PutObject when using cognitect-labs/aws-api? - I tried overriding the default multimethod for modify-http-request but no luck so far. It's relevant when uploading files so s3 and making them publicly accessible in one request

ghadi 2021-01-04T19:34:34.249300Z

Which AWS service(s) are you planning on exposing?

ghadi 2021-01-04T19:36:23.249800Z

Which s3 API?

borkdude 2021-01-04T19:38:48.250Z

all that are available in aws-api

1
borkdude 2021-01-04T19:40:24.250400Z

we have a working prototype, but there is some stuff around aws-api returning an inputstream for resources from s3 (and possibly others) which we have to translate into bytes, because it has to go over the wire via transit

borkdude 2021-01-04T19:40:48.250600Z

it seems that aws-api turns a byte buffer into an inputstream for some reason

lukasz 2021-01-04T19:52:19.251Z

Ah, forgot to mention - :PutObject

2021-01-04T20:10:40.251300Z

You can (should?) use :PutObjectAcl for this instead of messing with headers.

2021-01-04T20:11:32.251500Z

I see you want to do it in one request, but that’s not how it’s designed.

ghadi 2021-01-04T20:17:02.251700Z

is the ACL not available on PutObject? (aws/doc client :PutObject)

2021-01-04T20:17:04.251900Z

@lukaszkorecki it’s x-amz-acl, not x-aws-acl. Did your attempt with modify-http-request use the right header name?

ghadi 2021-01-04T20:18:34.252100Z

you should not need to mess with with modify-http-request for this

ghadi 2021-01-04T20:18:42.252300Z

pass :ACL

ghadi 2021-01-04T20:19:01.252500Z

@lukaszkorecki

2021-01-04T20:19:13.252700Z

> is the ACL not available on PutObject? No, @ghadi, it is not not available on PutObject.

2021-01-04T20:20:51.253100Z

FYI :ACL is also available on :CreateBucket

2021-01-04T20:24:46.253300Z

Apparently, my joke about “not not” was missed by at least one reader, so to clarify …. :ACL is absolutely, definitely, 100% a supported key on :PutObject

2021-01-04T20:25:11.253500Z

Got that @lukaszkorecki?

lukasz 2021-01-04T20:32:39.253700Z

I'll double check in ~45m, AFK right now. But thanks for the pointers - I'm fairy sure there were no typos, but I'll verify everything :thumbsup:

2021-01-04T20:33:26.253900Z

OK. I’d recommend you don’t worry about the header and just use the :ACL key in the :request map. Let us know how it goes!

lukasz 2021-01-04T21:24:15.254100Z

@dchelimsky that works, thank you! Next time, I'll check aws.client.api/doc

lukasz 2021-01-04T21:24:27.254300Z

as the ACL param is listed there, of course 🤦

2021-01-04T22:00:26.254500Z

Glad that worked out.