1
votes

How to correctly create and setup access_key_id and secret_access_key in Amazon Simple Email Service (SES), for aws-ses gem? In the description of the gem it is written to provide exactly them in the credentials file, but I can't figure out how to create them.

My configuration for aws-ses gem:

# config/initializers/amazon_ses.rb

ActionMailer::Base.add_delivery_method :ses, AWS::SES::Base,
                                       :server => 'email.us-west-2.amazonaws.com',
                                       :access_key_id => Rails.application.credentials.aws[:access_key_id],
                                       :secret_access_key => Rails.application.credentials.aws[:secret_access_key]

I configured the SES service itself by adding my personal domain to it and testing sending emails from the Amazon site. To use the service, it has SMTP settings - but they create a completely different type of key, which is not suitable for the aws-ses gem.

I also tried to use create keys when creating a new user through Identity and Access Management (IAM), specifying full access to Amazon SES.

But all this did not help, the Amazon SES service does not work, and when sending messages to SideKiq, I get errors in the form:
AWS :: SES :: ResponseError: InvalidClientTokenId - The security token included in the request is invalid.

1
Did you figure out any way? I am facing the same issue (AWS :: SES :: ResponseError: InvalidClientTokenId ) even thought the token is correctroshita

1 Answers

1
votes

There are several ways to specify credentials for the AWS SDK for Ruby. Hopefully the following topic helps you: https://docs.aws.amazon.com/sdk-for-ruby/v3/developer-guide/setup-config.html