I am looking to develop a work flow as follows
- The developers commit their code to github
- As soon as the Master branch changes (merge), through web hooks, it triggers a AWS CodePipeline where Build happens as a second stage using CodeBuild
- Ideally the work flow exists already for CodeDeploy or ECS where the built artifact replaces the task definition in ECS and updates the service. But I am looking for a lambda deployment.
It means, the built artifact or the zip file that gets uploaded to S3 bucket by CodeBuild should trigger a lambda function and also the lambda function code should be updated from the artifacts of CodeBuild.
Now I know one of the triggers for Lambda is S3 but it only triggers a already defined lambda function to execute but not update the function and execute it.
From the console, I do not think there is a way to do this directly. As complicated as it sounds, I am hoping there is a way.
Any pointers in that direction would be great.