【问题标题】:how to AWS lambda trigger mail using yaml file如何使用 yaml 文件触发 AWS lambda 邮件
【发布时间】:2019-11-28 11:46:40
【问题描述】:

过滤条件匹配时触发消息,在 yaml 文件中。

此代码触发消息到 sqs 队列,并显示消息也可用,但在端点消息未传递到用户 emailid。

政策: - 名称:高危人群 资源:安全组 描述: | 从允许开放端口进入的安全组中删除任何规则 并通知添加违规规则的用户。 过滤器: - 类型:入口 苹果酒: 值类型:cidr 操作:当量 值:“0.0.0.0/0” 模式: 角色:arn:aws:iam::91*******:角色/角色名 时间表:'cron(30/10 10 * * ? *)' 类型:周期性

actions:
 - type: notify
   template: default.html
   priority_header: 1
   subject: "Open Security Group Rule Created-[ {{ account }} - {{ region }}]"
   violation_desc: |
     "Security Group(s) Which Had Rules Open To The World:"
   action_desc: |
     "Actions taken"
     "Actions Taken: The Violating Security Group Rule Needs to be Removed As It
     Violates Our Company's Cloud Policy. Please Refer To The Cloud FAQ."
   to:
     - user@gmail.com
   transport:
     type: sqs
     queue: https://sqs.region-id.amazonaws.com/91*******/queuename
     region: eu-west-1

消息正在传递到队列,但未传递到用户邮箱。我们可以使用 SQS 而不是使用 SES/SNS 来触发邮件吗?

【问题讨论】:

  • 这是否适用于特定工具,例如 CloudCustodian? github.com/cloud-custodian/cloud-custodian
  • 是的,这是针对 cloudCustodian 的,我们可以使用 SQS 触发邮件吗?因为此代码正在正确执行队列中可用的消息。但它没有发送到提到的特定用户 ID

标签: amazon-web-services yaml amazon-sqs


【解决方案1】:

我在 official documentation 中没有找到任何内容,但我的理论是您不能将 to 字段与 sqs 传输类型混合。

actions 是一个列表,因此您可能应该有两个操作:一个使用电子邮件地址和 sns 传输类型(如文档中的示例),另一个仅使用 sqs 传输类型。

【讨论】:

    猜你喜欢
    • 2019-02-10
    • 1970-01-01
    • 2023-02-04
    • 2021-09-25
    • 2021-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-17
    相关资源
    最近更新 更多