【问题标题】:AWS::Serverless::Function SES send mail policy in CloudFormationAWS::Serverless::Function SES 在 CloudFormation 中发送邮件策略
【发布时间】:2019-05-23 21:28:01
【问题描述】:

我目前在我的 AWS SAM 模板中对 AWS::Serverless::Function 有以下定义:

PostSignUpConfirmationFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: ./dist/
      Handler: cognitoTriggers.handler
      Runtime: nodejs8.10
      Policies:
        - DynamoDBCrudPolicy:
            TableName: !Ref Table

如何添加使用 SES 发送电子邮件的权限?谢谢!

【问题讨论】:

    标签: amazon-web-services aws-lambda amazon-cloudformation amazon-ses sam


    【解决方案1】:

    当您使用AWS SAM 时,您可以简单地使用它的policy templates 来授予使用SES 发送电子邮件的权限。您可以使用一个名为SESCrudPolicy 的策略模板。您所要做的就是提供您想要授予访问权限的身份。看起来像:

    PostSignUpConfirmationFunction:
        Type: AWS::Serverless::Function
        Properties:
          CodeUri: ./dist/
          Handler: cognitoTriggers.handler
          Runtime: nodejs8.10
          Policies:
            - DynamoDBCrudPolicy:
                TableName: !Ref Table
            - SESCrudPolicy:
                IdentityName: identity_you_want_to_use
    

    【讨论】:

    猜你喜欢
    • 2018-09-28
    • 1970-01-01
    • 2013-06-07
    • 2018-12-08
    • 2022-05-23
    • 2020-03-07
    • 2018-06-24
    • 2011-08-07
    • 2020-10-20
    相关资源
    最近更新 更多