Lambda function directory structure implementation

0

Hey, community! I am new in AWS and I am trying to implement a lambda function with its dependencies. I am stuck. Please, guide me how to create the directory structure correctly and upload .zip to AWS portal, deploy and see the lambda function working. Here are my files. In lambda_function.py spelling_correction is used, in which wiki_fa_80k.vocab is used. Guide me to structure them including dependencies that they use.

Zhenya
asked 14 days ago146 views
1 Answer
1

Hello.

I think it is a good idea to upload files that can be installed with pip, such as "boto3", as a layer as described in the document below.
https://docs.aws.amazon.com/lambda/latest/dg/packaging-layers.html
https://docs.aws.amazon.com/lambda/latest/dg/creating-deleting-layers.html

Other classes such as "spelling_correction" are probably unique classes created in Python, so I think you can use them for now by uploading them together with "lambda_function.py" in a zip file.
https://docs.aws.amazon.com/lambda/latest/dg/python-package.html

Once you get used to operating AWS, I recommend using IaC such as AWS SAM.
https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html

profile picture
EXPERT
answered 14 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions