简体   繁体   中英

Can we send Failed logs of AWS codepipline through AWS-simple-notification-service?

I am trying setup my project deployment using AWS code-pipeline and I would like to get email notification when my deployment fails with code-pipeline logs without, so that I don't have login into AWS account every time to see the logs.

I searched through various blogs,documentation and examples but it didn't help.

The below JSON I used to create AWS-cloudwatch rule:

{
  "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"
    ]
  }
}

The email I am getting contains this 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
   }
}

I want the logs of AWS code-pipeline aswell.

Natively CodePipeline does not give any detail information on failure apart from the final error message on failure (as still those error will be mostly visible on specific stage) and it is not possible to see even that error via paylod as it is getting passed to the Event. Which is limitation with CodePipeline

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM