I want to deploy certain files pushed into my CodeCommit repo into an S3 bucket. I'm attempting to do this with a Lambda trigger on the repo. However, I cannot get a list of files changed in a commit nor request a specific file from CodeCommit using the AWS CodeCommit API.
Any suggestions would be greatly appreciated!
Yep, that capability is not in the CodeCommit API (yet... I assume/hope someone at AWS is working on it).
My suggestion would be some sort of CI job, such as a Jenkins job, using an IAM role that is configured for CodeCommit and S3 access, that regularly polls your repo(s), picks up the changes, and uses a language of your choice to handle the commit and push the changes to S3. Is this a round-about way of doing it? Yes, but I am unable to come up with an AWS-native way to do it at the moment. I would love to see someone suggest a better way.
来源:https://stackoverflow.com/questions/38270656/deploy-files-from-codecommit-to-s3