How to access AWS CodeBuild reports in a Lambda?
Asked Answered
R

1

0

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.

Risteau answered 25/1, 2021 at 22:39 Comment(4)
Is this what you are looking for? boto3.amazonaws.com/v1/documentation/api/latest/reference/…Effie
@Effie I believe that's exactly what I'm looking for! I'll try it out and reply with my results here, thanks!Risteau
You should give him a vote for his comment.Herbherbaceous
Wish I could but I don't see a button for that. Too low reputation to vote on comments maybe?Risteau
R
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

Risteau answered 26/1, 2021 at 16:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.