Skip to content
An image resizing API with Python and Serverless framework
Python
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.env.example Deploy via serverless-python-requirements Serverless plugin May 16, 2019
.gitignore Deploy via serverless-python-requirements Serverless plugin May 16, 2019
README.md Deploy via serverless-python-requirements Serverless plugin May 16, 2019
handler.py Clean up Python code May 16, 2019
package-lock.json Deploy via serverless-python-requirements Serverless plugin May 16, 2019
package.json
requirements.txt Add boto3 to requirements.txt Apr 9, 2019
serverless.yml Deploy via serverless-python-requirements Serverless plugin May 16, 2019
setup.cfg Deploy via serverless-python-requirements Serverless plugin May 16, 2019

README.md

Dynamic image resizing with Python and Serverless framework

In this example, we set up a dynamic image resizing solution with AWS S3 and a Serverless framework function written in Python. We use Pillow for image resizing.

Pre-requisites

In order to deploy the function, you will need the following:

  • API credentials for AWS with persmissions to manage S3, IAM and API Gateway
  • If not on Linux - Docker installed locally

Deploying the Serverless project

  1. Make a .env file with your AWS credentials, as in .env.example
  2. Deploy the Serverless project:
source .env
sls deploy

Example usage

https://XXX.execute-api.eu-west-1.amazonaws.com/dev/100x100/test.jpg
You can’t perform that action at this time.