Figuring out the best way of triggering a Lambda Code Pipeline S3 depoyment is a key part of a serverless architecture.
It can be really useful when you want your app to update pending an update from a 3rd party service.
I’ve posted the Lambda function below (with comments) so you can trigger a Lambda Code Pipeline S3 depoyment! I’ve also written a similar post to this on how to add authentication to S3 bucket with Lambda functions, that you may find helpful! Enjoy 😀