aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
agilecreativity 2020-05-31T22:50:34.256200Z

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."

agilecreativity 2020-05-31T22:54:08.258200Z

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 {:.. }})

agilecreativity 2020-05-31T22:55:36.259600Z

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?

agilecreativity 2020-05-31T22:56:26.259900Z

I don’t see useful logs in aws

ghadi 2020-05-31T22:57:59.260400Z

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

agilecreativity 2020-05-31T22:59:27.261Z

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

agilecreativity 2020-05-31T22:59:43.261500Z

I assumed that it will use default profile?

ghadi 2020-05-31T22:59:47.261700Z

no

ghadi 2020-05-31T22:59:55.262Z

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

ghadi 2020-05-31T23:00:02.262400Z

leave off the :credentials-provider

ghadi 2020-05-31T23:00:58.263400Z

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

agilecreativity 2020-05-31T23:01:10.263900Z

You mean just do

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

ghadi 2020-05-31T23:01:14.264200Z

yes

agilecreativity 2020-05-31T23:01:22.264600Z

Let me give that a try.

ghadi 2020-05-31T23:01:26.264700Z

you don't need to give the region either

ghadi 2020-05-31T23:01:30.265Z

if the region is the same as the lambda

agilecreativity 2020-05-31T23:01:45.265200Z

Let me try that.

agilecreativity 2020-05-31T23:07:27.266600Z

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