Access Denied while sending email from AWS SES in Lambda function

前端 未结 6 2031
暗喜
暗喜 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:49

    If you are configuring policies for a SAM Lambda or using a YAML configuration file, you would use something like this:

    template.yaml

    AWSTemplateFormatVersion: '2010-09-09'
    Transform: AWS::Serverless-2016-10-31
    Description: 'your-email-lambda'
    
    Resources:
      YourEmailFunction:
        Type: AWS:Serverless::Function
        Properties:
          Policies:
            - Version: '2012-10-17'
              Statement:
                - Effect: Allow
                  Action:
                    - 'ses:SendEmail'
                    - 'ses:SendRawEmail'
                  Resource: '*'
    

提交回复
热议问题