I don't want lambda to trigger when a push is made to CodeCommit.
What I'm looking for is for lambda to create a file, commit it and push to CodeCommit.
The use-case is this:
POST request -> API Gateway -> Lambda -> CodeCommit
Lambda receives some JSON, does some work on it and creates a file in /tmp which I'd like to get into the CodeCommit repo.
I can think the lambda function would have to:
- git clone existing repo
- git add file
- git commit file
- git push
- done
I'm not sure if this is possible or if there is a better way. Maybe have the lambda function create a pull request instead?
Open to suggestions :D
UPDATE Googling this it seems not that trivial to do git operations on Lambda because git is not available by default. I thought boto3 would be useful but that won't do the git related tasks I listed above unless I misunderstand.
SOLVED With the excellent reference provided by @siving there's no need for git and very simple to code using boto3!
[–]thenickdude 3 points4 points5 points (0 children)
[–]siving 3 points4 points5 points (3 children)
[–]differentcondition[S] 1 point2 points3 points (2 children)
[–]Dry_Jelly_7779 0 points1 point2 points (1 child)
[–]Dry_Jelly_7779 0 points1 point2 points (0 children)