Codebuild build status to Lambda function

0

Hey, I have a codebuild project what i want is when codebuild buid complete we can get the completion notification on lambda so through lambda i can start and stop the ECS fargate task. So is there any way to we can get codebuild build status ?

Thanks in advance....

질문됨 일 년 전493회 조회
3개 답변
1

You can integrate AWS CodeBuild with many AWS services.

This blog post shows you an example how to set up automated testing of pull requests using AWS CodeCommit, AWS CodeBuild, and AWS Lambda. In addition, it shows you how to set up a pipeline to automatically build your tested, approved, and merged code changes using AWS CodePipeline.

Also refer to this GitHub repository mentioned in the blog post. There, you can find an example how to connect a CodeBuild project to a Lambda function to process the CodeBuild build state changes.

Diagram

profile pictureAWS
답변함 일 년 전
  • Hi, I am using CloudWatch event to get the codebuild events to Lambda function. I am successfully getting the code build events in Lambda function. But now I want to start/stop ECS Fargate service task from lambda function only. For this I am using python boto3 library and able to get ECS services and task. So now I have ECS services & task and code build project name. So on what basis I start/stop particular ECS Fargate task of a particular codebuild project. Can I get ECS Fargate service from codebuild itself ? If this is possible then it's so easy to implement. Thanks in advance

1

Yes you can create notifications to SNS (see https://docs.aws.amazon.com/codebuild/latest/userguide/notification-rule-create.html) then subscribe a Lambda function to process them.

Note there's some common notifications management across all of the developer tools (CodeCommit, CodeBuild etc) in the Developer Tools Console. It has some "Code*" / "CodeStar" branding in the underlying APIs.

전문가
답변함 일 년 전
0

Is there any blog or post on that . So it will help me in doing the process

답변함 일 년 전
  • Please note that you should post clarifying questions as comments, not as answers.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠