how to add a dependency layer to the lambda (requi...
# help
s
how to add a dependency layer to the lambda (requirements.txt) file?
f
@Sergey Antonenko by “dependency layer”, do u mean something like on deploy, u download the dependencies in
requirements.txt
, bundle them as a layer, and then use the layer in ur function?
s
yes, correct @Frank
f
can I see what ur folder structure looks like? ie. where’s ur python handler code and where is ur requirements.txt?
s
@Frank i just want to create
rds db
and create rest api with
python lambda
as backend. i used
boto3
python library for db connection and i want to add it to layer.
@Frank
f
@Sergey Antonenko just to confirm, you want to package
boto3
into a layer and use the layer in ur Lambda function, correct?
s
@Frank yes, correct. using sst
k
@Sergey Antonenko You only need boto3 locally - in AWS runtimes it's already provided out of the box, so a layer is overkill to my mind.
Your code runs in an environment that includes the SDK for Python (Boto3), with credentials from an AWS Identity and Access Management (IAM) role that you manage.