I have a pipeline with 4 stages, source, build, deploy, and then a Lambda stage. In the lambda stage, I run one function to move some files around in s3.
The s3 function works, I can see that the s3 files have been moved, but the Lambda stage never succeeds it always times out. After some digging around I think this is because CodePipeline is passing the wrong JobId to Lambda because if I log the incoming event I can see that the id value is different to the id that is running in the pipeline history tab.
The function is set up to run both putJobSuccessResult() and putJobFailureResult(), and they work because if I then copy the id from the history tab of the pipeline and put it into a test event in Lambda and run the test then the pipeline succeeds instead of times out.
I have searched for answers for hours but I can't seem to find any solution, or even really anyone else with the same problem. I am fairly new to AWS as a whole so maybe I am missing something.
Any help would be really appreciated, thank you.
Updated:
I am using the following to get the jobid:
var jobId = event["CodePipeline.job"].id;