Uploading Static Content to S3

I want to be able to upload my static resources (website) to S3 to serve the content. Since we are planning to use serverless to deploy our micro services, it would be nice to use serverless to deploy the static content as well. I checked the S3 client plugin. However, it does not seem to work with the latest version of serverless.

There seems to be a fix, however, the pull has not been integrated. Are there any plan to support uploading static content to S3?

If you would like to serve static website resources on serverless there is a working example in the docs: https://github.com/serverless/serverless/tree/master/docs/providers/aws/examples/web-serving-html/node. However, it uses an api gateway endpoint and a lambda to serve content so not sure if it will fit your use case.

1 Like

I would try using the serverless-s3-crud, you can easily install the service with serverless install --url https://github.com/tscanlin/serverless-s3-crud and then use said service as outlined in the readme to upload, update and delete you files in s3.

Serverless Framework is a brilliant toolset and I personally can’t get enough of it right now. But not every problem should be addressed with the same tool (IMHO). I use S3 for hosting client applications and since Gulp is my task runner I have long used gulp-awspublish. I’m not disparaging serverless, just offering a possible alternative to consider.

1 Like

I’m interested to know the most common solution to this these days.