An easy way to use PostgreSQL with psycopg2 when using Python with Lambda. Until now, importing psycopg2 has been a hassle.
I will use Mischa Spiegelmock's Lambda layer.
https://github.com/jetbridge/psycopg2-lambda-layer
Lambda3.8 Tokyo Region ap-northeast-1
arn:aws:lambda:ap-northeast-1:898466741470:layer:psycopg2-py38:1
If you specify arn for the layer, it's OK. You can import with just this!
It was easy to build from Code on Github and make it a layer.
Qiita: Before creating a layer of Python external library on AWS Lambda https://qiita.com/polarbear08/items/202752d5ffcb65595bd9
Recommended Posts