Fork me on GitHub
#aws
<
2017-09-18
>
hlolli14:09:04

hi all, I'm useing s3 for the first time, better late than never. I have a profile in ~/.aws/credentials (eg [my-profile] \n aws_access_key_id= .. etc..) but when I want to put an object on my s3 bucket, it's as if my credentials aren't found

Unhandled com.amazonaws.SdkClientException
   Unable to load AWS credentials from any provider in the chain
my command with amazonica is
(s3/put-object :bucket-name "hlolli"
               :key "throwme"
               :file userscript-file)

hlolli15:09:32

ah ok, I have to defcredentials and I can look it up from my profile via

(def bucket-credentials
  (.getCredentials
   (amazonica.core/get-credentials {:profile "my-profile"})))
not so well documented (found this via issues).

bja16:09:42

also, if you use com.amazonaws.auth.DefaultAWSCredentialsProviderChain you'll end up looking up in ~/.aws/credentials

bja16:09:50

unsure if amazonica uses that under the hood or not (probably does)