Fork me on GitHub
#aws
<
2020-05-31
>
agilecreativity22:05:34

Hi, I am using cognitect/aws library and trying to interact with sesv2 I keep getting the following errors when trying during the remote invoke

"cognitect.anomalies/category": "cognitect.anomalies/fault",
 "cognitect.anomalies/message": "Unable to fetch credentials. See log for more details."

agilecreativity22:05:08

When trying to invoke it locally, I get the proper result What I am using is something like:

(def credentils (creds/profile-credentials-provider))

(def ses-client (aws/client {:region :us-east-1
                             :api :sesv2
                             :credentials-provider credentils}))
;; ...
(aws/invoke ses-client {:op {:SendMail ...}
                        :request {:.. }})

agilecreativity22:05:36

I double check my signature and I can also see that the

(aws/validate-request ses-client) ;;=> true
For both running locally, and remotely via the AWS Lambda Anything that I may have missed?

agilecreativity22:05:26

I don’t see useful logs in aws

ghadi22:05:59

@agilecreativity do you have profile credentials in ~/.aws/config?

agilecreativity22:05:27

Locally I do, but since I am running it through the AWS Lambda, I am not sure how to check it.

agilecreativity22:05:43

I assumed that it will use default profile?

ghadi22:05:55

if you're running in lambda, you don't need to provide any config

ghadi23:05:02

leave off the :credentials-provider

ghadi23:05:58

you probably don't need to provide any explicit config locally either

agilecreativity23:05:10

You mean just do

(def ses-client (aws/client {:region :us-east-1
                             :api :sesv2})

agilecreativity23:05:22

Let me give that a try.

ghadi23:05:26

you don't need to give the region either

ghadi23:05:30

if the region is the same as the lambda

agilecreativity23:05:45

Let me try that.

agilecreativity23:05:27

@ghadi It works! - I spent an hour try to get this to work. Thanks again.