How to access AWS CodeBuild reports in a Lambda?

我是研究僧i 提交于 2021-01-29 20:08:49

问题


At the moment I have an EventBridge sending CodeBuild build phase updates that have status "FAILED" to a Lambda. Specifically - unit tests are run and then a report is created that contains information about all the tests that were run. The event that is received by my Lambda from CodeBuild contains ARN for the reports and I would like the Lambda to read that ARN, access the report and output what's gone wrong.

I can't seem to find a way to access the CodeBuild report within a Lambda - AWS CDK API reference doesn't seem to have anything for that within the CodeBuild sections. I have the ARN for the generated report, I just don't know how to make my Lambda read it.


回答1:


https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/codebuild.html#CodeBuild.Client.batch_get_reports was exactly what I was looking for. Searched around and couldn't see it, and here it is! describe_test_cases() is exactly what I needed for this.

Thanks for the link @jingx



来源:https://stackoverflow.com/questions/65893406/how-to-access-aws-codebuild-reports-in-a-lambda

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!