Skip to content
This repository was archived by the owner on May 19, 2024. It is now read-only.

Commit 4b804d1

Browse files
pismyheitorlessa
andauthored
feat(packaging): use Lambda Layer; remove dev deps (#40)
Co-authored-by: Heitor Lessa <[email protected]>
1 parent a1135fc commit 4b804d1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
boto3
2-
aws-lambda-powertools
1+
# Those dependencies can be omitted:
2+
# - boto3 is part of Lambda runtime for Python
3+
# - aws-lambda-powertools is embedded as a layer (see SAM template)
4+
# This is always a good practice as your lambda packaged code will be much lighter, and it will be invoked quicker
5+
6+
# boto3
7+
# aws-lambda-powertools

{{ cookiecutter.project_name }}/template.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ Globals: # https://docs.aws.amazon.com/serverless-application-model/latest/devel
2323
AutoPublishAlias: live # More info about Safe Deployments: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-deploymentpreference.html
2424
DeploymentPreference:
2525
Type: Linear10PercentEvery1Minute {% endif %}
26+
# Embed Lambda Powertools as a shared Layer
27+
# See: https://awslabs.github.io/aws-lambda-powertools-python/latest/#lambda-layer
28+
Layers: #
29+
- !Sub arn:aws:lambda:${AWS::Region}:017000801446:layer:AWSLambdaPowertoolsPython:6
2630
Environment:
2731
Variables:
2832
# Powertools env vars: https://awslabs.github.io/aws-lambda-powertools-python/#environment-variables

0 commit comments

Comments
 (0)