我们可以通过AWS-simple-notification-service发送AWS代码pipline的失败日志吗?



我正在尝试使用 AWS 代码管道设置我的项目部署,我希望在部署失败时收到电子邮件通知,并且没有代码管道日志,这样我就不必每次都登录 AWS 账户查看日志。

我搜索了各种博客,文档和示例,但没有帮助。

下面我用来创建AWS-cloudwatch规则的JSON:

{
  "detail-type": [
    "CodePipeline Stage Execution State Change",
    "CodePipeline Action Execution State Change",
    "CodePipeline Pipeline Execution State Change"
  ],
  "source": [
    "aws.codepipeline"
  ],
  "detail": {
    "pipeline": [
      "ui-pipeline"
    ],
    "state": [
      "FAILED"
    ]
  }
}

我收到的电子邮件包含以下 JSON:

{
   "version":"0",
   "id":"xxx-493f-de1d-94b7-xxx",
   "detail-type":"CodePipeline Stage Execution State Change",
   "source":"aws.codepipeline",
   "account":"xxxx",
   "time":"2019-06-13T05:50:17Z",
   "region":"ap-south-x",
   "resources":[
      "arn:aws:codepipeline:ap-south-1:xxx:ui-pipeline"
   ],
   "detail":{
      "pipeline":"ui-pipeline",
      "execution-id":"xxx-fbcf-40f7-xxx-xxxx",
      "stage":"Deploy",
      "state":"FAILED",
      "version":1.0
   }
}

我也想要AWS代码管道的日志。

Natively CodePipeline 除了失败的最终错误消息外,不会提供有关失败的任何详细信息(因为这些错误仍然在特定阶段大部分可见(,并且甚至无法通过 paylod 看到该错误,因为它正在传递给事件。这是CodePipeline的限制

相关内容

  • 没有找到相关文章

最新更新