Or Betzalel
Or Betzalel

Reputation: 2597

Trigger AWS code pipeline with a lambda webhook

I need that my AWS Code pipeline will run only when certain files are checked-in to my bitbucket repository in a certain branch.

I manage to achieve this with AWS Code build but as I understand it's not as simple with code pipeline.

I understand I need to attach a webhook to a lambda function which will trigger the pipeline (if needed). But I couldn't find anything about it in the management console. Searching for it only led me in circles.

It should be pretty straight-forward, Anyone has any experience with this?

Upvotes: 1

Views: 1239

Answers (1)

Chris Williams
Chris Williams

Reputation: 35258

So what you need to implement is the following workflow:

  • Create an API Gateway endpoint.
  • Create your CodePipeline pipeline
  • Create your Lambda function that will perform any checks against the code and trigger your CodePipeline
  • Create a method/resource in API Gateway that triggers your Lambda

Then add the API Gateway endpoint to your Bitbucket web hook.

Upvotes: 4

Related Questions