Using psycopg2 with Lambda to Update Redshift (Python)

前端 未结 7 1701
情深已故
情深已故 2020-11-27 19:36

I am attempting to update Redshift from a Lambda function using python. To do this, I am attempting to combine 2 code fragments. Both fragments are functional when I run the

相关标签:
7条回答
  • 2020-11-27 20:03

    Another way to use psycopg2 on lambda (if you are programing on windows and using python 3.6 on lambda)

    1. In your machine create a directorie called python
    2. Donwload the lib psycopg2 from https://pypi.org/project/psycopg2-binary/, search for the correct pakage (amazon linux is 86_64): psycopg2_binary-2.8.4-cp36-cp36m-manylinux1_x86_64.whl
    3. Unzip this to the directorie python that you created, you can use 7-zip for .whl
    4. Zip the directorie python
    5. Now in the AWS lambda panel, create a layer with the python.zip that you have
    6. Finally add the layer to your lambda funcion
    0 讨论(0)
提交回复
热议问题