- 最新
- 最多得票
- 最多評論
There's not a lot to go on here - for example, it's impossible to tell whether there is a library missing or it's some other dependency so I can only give generic advice.
If you are using Python packages in your Lambda the best thing you can do is package them (those packages/dependencies) in the function. There are a couple of ways of doing this: Using a ZIP file or using a container image - use whichever is most comfortable for you - if you haven't had experience with containers then the ZIP file is probably the way to go.
Note that you should create the ZIP on an Amazon Linux 2 instance in order to get package for the appropriate architecture that is compatible with Lambda. And with some careful coding (or by creating a separate Python utility) you will be able to test that your packaging is working correctly prior to putting it into a ZIP and uploading to Lambda.
In my experience, ensuring that all the packages are included with your function handler is the best way to avoid the issue you're having.
相關內容
- AWS 官方已更新 3 年前
- AWS 官方已更新 1 年前