Package Exports
- sls-py
- sls-py/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sls-py) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
sls-py-pkg
plugins:
- sls-py
provider:
name: aws
runtime: python3.9
region: eu-west-1
vpc:
subnetIds: !Split [",", "subnet-id1,subnet-id2"]
securityGroupIds: !Split [",", "sg-id1,sg-id2"]
custom:
pythonRequirements:
vpc: ${self:provider.vpc}
indexUrl: https://pypi.org/simple
extraIndexUrl: https://pypi.org/simple
trustedHost: pypi.org
shared:
common_utils:
source: ../shared
functions:
- hello
exclude:
- somefile.txt
- data.tmp
functions:
hello:
handler: handler.hello
Note
filter using the
exclude
option.
In handler.py, shared code can be imported like this:
from common_utils import shared_resource
Requirements
- python & pip installed
- minimum required node version >= 16
Features
shared
is attached to all the lambdas.- you can place repeated dependencies inside your shared layer to:
- save space.
- reduce cold startup time.
- faster deployments.
- you can place repeated dependencies inside your shared layer to:
exclude
works for excluding code and dependencies alike.
License: lgpl-3.0 or later