Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 1.38 KB

File metadata and controls

60 lines (44 loc) · 1.38 KB

Image Handler

Setup Serverless

npm install -g serverless
serverless config credentials --provider aws --key <ACCESS KEY ID> --secret <SECRET KEY>

Python & Domain Requirements

serverless plugin install -n serverless-python-requirements
serverless plugin install -n serverless-domain-manager

Add the following to the serverless.yml file

plugins:
  - serverless-python-requirements
  - serverless-domain-manager

custom:
  pythonRequirements:
    dockerizePip: true

Deploy

npm install
serverless create_domain # can take up to 40 minutes
serverless deploy

Invoke Function

You can invoke your deployed functions using the following

# Activate a python envirionment locally
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt

# Test locally
serverless invoke local -f selfie --path test_data.json
serverless invoke local -f count

# Test Deployed version
serverless invoke -f selfie --path test_data.json

Attribution