Search code examples
aws-lambdaamazon-sqsamazon-cloudwatchamazon-ses

AWS Lambda integration with SES


I have tried to integrate SQS, AWS Lambda with SES (Email service). But I am not able send messages.

Even It doesn't create any cloudwatch logs for troubleshooting. Could someone tell why cloudwatch logs are not generating?

I am expecting to see logs if email sending is failed


Solution

  • I believe the issue is with that permission of role which attached to your Lambda function. The role should have permission to access SQS (ReceiveMessage) and SES (SendEmail).

    For troubleshoot, add following permission to the lambda role. This permission allows you to see the Cloudwath logs and identify the issue.

    {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Effect": "Allow",
                  "Action": [
                      "logs:*"
                  ],
                  "Resource": "arn:aws:logs:*:*:*"
              }
          ]
    }
    

    if you want further clarification (Step by step), please check these videos.

    https://www.youtube.com/watch?v=p1jNJLJoP9s&t=400s

    https://www.youtube.com/watch?v=y57oIlK9mHc&t=490s