Edit serverless.yml
service: elasticpypi
provider:
name: aws
runtime: python2.7
memorySize: 128
stage: dev
# profile: "some-local-aws-config-profile"
# region: us-east-1
environment:
SERVICE: ${self:service} # See above. Defaults to elasticpypi
STAGE: "/${self:provider.stage}" # See above. Defaults to dev
BUCKET: "elasticpypi" # CHANGE ME
TABLE: "elasticpypi" # You can change me if you want, but do you?
USERNAME: "elasticpypi" # You can change me if you want, but do you?
PASSWORD: "something-secretive" # CHANGE ME
npm
/yarn
and pip
are required to install the necessary packages to deploy.
yarn
or npm install
sls deploy
When deploying do not have the virtualenv activated. The wsgi
plugin for serverless will automatically fetch the python requirements.
Based on the output of the deploy command or via the AWS console add the url to your pip conf.
The url should be something like https://blah.execute-api.region.amazonaws.com/dev/simple
.
Make sure you add a trailing slash as required in the PEP.
Make sure you add your basic authentication credentials to your url.
AWS resources maybe throttled. As such, if you are intending to dump a bunch of packages into the S3 bucket check your service and account limits. Additionally, changing the read and write capacity of dynamodb may help. It is currently set to the lowest possible unit (1).