Fork me on GitHub
#aws
<
2019-12-24
>
holyjak15:12:00

I've just published https://blog.jakubholy.net/2019/secure-repl-for-aws-fargate-services/ Feedback and improvements welcome! Also, Merry 🎄!

ghadi15:12:11

@holyjak I enjoyed that, thanks!

holyjak18:12:59

Thank you! I've now fixed links to the Tf modules

danielglauser20:12:09

Trying to use the Cognitect aws-api project to interact with S3. I can invoke ListBuckets however if I try anything else like ListObjectsV2 or PutObject all I get back is:

{:cognitect.anomalies/category :cognitect.anomalies/fault,
 :cognitect.aws.client/throwable nil}

danielglauser20:12:35

Does anyone know how I can get more information to see what’s failing?

ghadi20:12:54

Need more info. Can you post your client construction and invocation?

danielglauser20:12:18

(def s3 (aws/client {:api :s3                                                |
                        :credentials-provider (credentials/basic-credentials-provider
                                               creds)}))

(aws/invoke s3 {:op :ListBuckets})
<correct response>

(aws/invoke s3 {:op :ListObjectsV2 :request {:Bucket "valid-bucket-name"}})
{:cognitect.anomalies/category :cognitect.anomalies/fault,
 :cognitect.aws.client/throwable nil}

ghadi20:12:58

What region is the bucket in?

danielglauser20:12:46

US West (N. California)

ghadi20:12:28

What region is the client/code in?

ghadi20:12:36

They have to match

ghadi20:12:29

Is AWS_REGION is set in your env?

ghadi20:12:41

@danielglauser

ghadi20:12:57

Alternatively you can pass an option on the client constructor

danielglauser20:12:49

I have not set the region anywhere, didn’t think I needed to because ListBuckets worked with out it. I’ll try setting it in the client constructor.

ghadi20:12:18

ListBuckets is a global op, the others are bucket (region-bound) ops

ghadi20:12:38

but the error is not helpful, I'll see if we can tighten that up

ghadi20:12:19

in general if you are running in AWS (EC2, Lambda, ECS) the client ctor doesn't need any options because everything is autodiscovered

ghadi20:12:32

locally I set AWS_PROFILE and have the region+creds in ~/.aws/

ghadi20:12:48

hope that helps

danielglauser20:12:58

Adding :region "us-west-1" to the client constructor did the trick. Thanks @ghadi!