Skip to content

Commit

Permalink
Merge pull request #2 from Saatwik-Mehta/layers
Browse files Browse the repository at this point in the history
Layers - enhancement to layers
  • Loading branch information
Saatwik-Mehta authored Feb 26, 2025
2 parents 5c7341f + 974930a commit 98e23f4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
deploy:
Expand All @@ -32,7 +29,7 @@ jobs:
run: |
mkdir -p layer/python/Utils # creating new directory for layers.
cp -R ./Utils/ layer/python/ # copying Utils folder into layers/python/ folder
pip install -r ./Utils/requirements.txt --target .layer/python/
pip install -r ./Utils/requirements.txt --target ./layer/python/
- run: npm install
- name: serverless deploy
uses: serverless/github-action@v4
Expand Down
8 changes: 8 additions & 0 deletions layers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Utils:
path: layer
name: Utils
description: lambda layer for all common functions
compatibleRuntimes:
- python3.11
- python3.12
retain: false
5 changes: 4 additions & 1 deletion serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ provider:
runtime: python3.12
region: ap-south-1

layers: ${file(./layers.yml)}

functions:
hello:
handler: handler.hello

layers:
- { Ref: UtilsLambdaLayer }

plugins:
- serverless-python-requirements

0 comments on commit 98e23f4

Please sign in to comment.