Access Denied while sending email from AWS SES in Lambda function

前端 未结 6 2045
暗喜
暗喜 2021-02-18 14:24

I am trying to send an email using Amazon SES in AWS Lambda function, For this i am facing the following error.

AccessDenied: User arn:aws:sts::XXXX

6条回答
  •  忘掉有多难
    2021-02-18 14:42

    As what others said you should add this two permissions: ses:SendEmail,ses:SendRawEmail

    I just want to add explaination for those who use Serverless framework

    In serverless.yml:

    provider:
      name: aws
      stage: dev
      runtime: nodejs10.x
      region: us-west-1
      iamRoleStatements:
        - Effect: Allow
          Action:
            - dynamodb:Query
            - dynamodb:Scan
            - dynamodb:GetItem
            - dynamodb:PutItem
            - dynamodb:UpdateItem
            - dynamodb:DeleteItem
            - lambda:InvokeFunction
            - ses:SendEmail            # add this
            - ses:SendRawEmail         # add this
          Resource: '*'                # add this
    

提交回复
热议问题