在创建Python外部库层之前,使用AWS Lambda
結論就是最後的結果或結果意見。
先问问祖先们是否已经制作好了,让我们先确认一下。
用法 fǎ)
只要有Numpy + Scipy,作为一个例子,我们可以使用pandas。注意到在AWS官方中为什么没有提供pandas库。
前期准备

1. 导入pandas库,并创建测试



查询pandas Layer的ARN,并添加Layer。
以下列出的是必要的两个信息。
-
- Lambda実行環境のPythonのバージョン
- Lambda関数が所属しているリージョン


点击”保存”按钮。
3. 证实

在已经导入pandas的情况下,可以确认函数已经正常结束。
可用的库列表已提供Layer。
-
- aiobotocore
-
- aiohttp
-
- ansible
-
- aws-lambda-powertools (Python3.8 only)
-
- arrow
-
- aws-xray-sdk
-
- bcrypt
-
- beautifulsoup4
-
- boltons
-
- boto3
-
- construct
-
- dynamodb-encryption-sdk (Python3.8 only)
-
- elasticsearch
-
- envelopes
-
- ffmpeg-python
-
- flashtext
-
- google-auth
-
- google-auth-oauthlib
-
- grpcio
-
- gspread
-
- idna
-
- itsdangerous
-
- kafka-python
-
- nltk
-
- numpy
-
- opencv-python-headless
-
- openpyxl
-
- pandas
-
- parliament (Python3.8 only)
-
- Pillow
-
- pulp
-
- pycryptodome (Python3.8 only)
-
- PyJWT
-
- pymongo
-
- PyMUPDF
-
- PyMySQL
-
- PyNaCl
-
- pyOpenSSL
-
- pyparsing
-
- pyqldb
-
- pytesseract
-
- python-docx
-
- python-Levenshtein
-
- pytz
-
- PyYAML
-
- reportlab (Python3.8 only)
-
- requests
-
- simplejson
-
- slackclient
-
- spacy
-
- SQLAlchemy
-
- textdistance
-
- tinydb
-
- tldextract
- twilio
结束
如果有依赖于操作系统的函数,那么在Lambda的执行环境下必须创建一个与相同操作系统的zip文件,稍微有些麻烦。
如果只是想在Lambda中轻松使用外部库,那么我们应该感激前人已经为我们开辟的道路。
如果在Lambda上有其他可用的语言,并且存在类似的github仓库或相关资源,如果可以告诉我,我将非常感激。
(我已经大致搜索过,但没有找到。)