Issue with authentication from Java Spring to AWS SES service

0

I have a Spring Boot app where at some occasions I am sending automated emails. My App is hosted on AWS ECS(Fargate) and is using AWS SES for sending emails. I added a role to my Fargate task with all needed permissions for AWS SES. Most of the times, app is able to authenticate and send emails correctly however at some occasions authentication fails and because of that email/s are not send. The error I am receiving is:

Unable to load AWS credentials from any provider in the chain: EnvironmentVariableCredentialsProvider: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY)), SystemPropertiesCredentialsProvider: Unable to load AWS credentials from Java system properties (aws.accessKeyId and aws.secretKey), WebIdentityTokenCredentialsProvider: To use assume role profiles the aws-java-sdk-sts module must be on the class path., com.amazonaws.auth.profile.ProfileCredentialsProvider@6fa01606: profile file cannot be null, com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper@4ca2c1d: Failed to connect to service endpoint

Now, if this would happen each time I would conclude that I configured something incorrectly. However, since authentication fails only sometimes I am not sure what the problem is.

I am using the following aws-sdk version: 1.12.197 When I am building a client, I am doing it on the following way:

AmazonSimpleEmailService client = AmazonSimpleEmailServiceClientBuilder.standard() .withRegion(Regions.US_EAST_1).build();

Thank you for help.

已提问 2 年前79 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则