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....

3 Respostas
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
respondido há um ano
  • 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.

ESPECIALISTA
respondido há um ano
0

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

respondido há um ano
  • Please note that you should post clarifying questions as comments, not as answers.

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas