https://github.com/adminy/sls-py
https://github.com/adminy/sls-py
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/adminy/sls-py
- Owner: adminy
- Created: 2023-05-10T23:16:44.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-19T12:17:47.000Z (over 1 year ago)
- Last Synced: 2024-01-19T13:36:35.811Z (over 1 year ago)
- Language: JavaScript
- Size: 45.9 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sls-py

```yaml
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:
# shared properties across all lambda functions
enableLambdaInsights: true
vpc: ${self:provider.vpc}
timeout: 900
# pip arguments for dependency installation
indexUrl: https://pypi.org/simple
extraIndexUrl: https://pypi.org/simple
trustedHost: pypi.org
# common modules between all lambda functions
shared:
common_utils: ../shared
common_data: ../data
# files and directories to exclude
exclude:
- somefile.txt
- data.tmpfunctions:
hello:
handler: handler.hello
```
---
> **Note**> filter using the `exclude` option.
>In handler.py, **shared** code can be imported like this:
```py
from common_utils import shared_resource
```## Requirements
---
- [x] python & pip installed
- [x] 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.
- much faster deployments.
- `exclude` works for excluding code and dependencies alike.License: [lgpl-3.0 or later](https://www.gnu.org/licenses/lgpl-3.0.txt)