简体   繁体   中英

Is it possible to send CodeBuild CloudWatch logs to slack?

How can we send CloudWatch logs of a CodeBuild project to Slack after all phases have been completed?

I have found there are ways to send the status of phases to Slack. Is there some similar functions for sending the logs?

CodeBuild sends logs to either CloudWatch or S3 depending on your configuration. After your build has completed you can trigger a Lambda function which fetches the logs from S3 or CloudWatch and sends them to Slack. The trigger cloud be EventBridge event or maybe S3 event depending on whether CodeBuild sends all the logs in a single file after the whole build is completed.

Some links to help you get going:

https://api.slack.com/methods/files.upload

https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html#sample-build-notifications-ref

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-logsconfig.html

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