Upload Files to S3 During Deploy

I have seen similar topics on this (e.g, serverless-finch, aws cli) on how to upload file(s) to S3.

In a nut shell I want to deploy some configuration files to S3 as part of my deploy. Are there any examples where I can explicitly define what files and where they will be deployed?



The Serverless Framework doesn’t support this out of the box which is why you need to use a plugin like serverless-finch or write your own deployment script using the AWS CLI. If you have more than a few files that need uploading then you’ll probably want to have a local folder that matches what you want S3 to look like.

I’m currently deploying our website via an NPM script because it’s a separate project.

"deploy": "aws s3 cp YOUR_SOURCE_FOLDER s3://YOUR_S3_BUCKET/ --profile YOUR_AWS_PROFILE --recursive --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --cache-control \"max-age=30\""

If it was part of the same project as the API then I’d probably use serverless-finch instead.

Thank you for confirming my options. I’m using boto scripts for the custom stuff as part of my CI/CD and finch as part of service configs.