0

how can I write node.js lambda function to call code build function to auto rebuild the project without any manual operations

1 Answer 1

3

For the lambda You can use aws sdk to do that, example :

const AWS = require("aws-sdk");
const codebuildSDK = new AWS.CodeBuild();
const build = {
   projectName: "MyProjectBuild"
};
result = await codebuildSDK.startBuild(params).promise();

but if you want, you can directly use Cloud watch event to run directly a Codebuild as a target https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatch-Events-tutorial-codebuild.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.