foo.py
이라는 파이썬 스크립트가 있습니다.AWS의 모듈을 가져올 수 없습니다. Lambda (Python)
def handler(event, context):
for record in event['Records']:
bucket = record['s3']['bucket']['name']
key = record['s3']['object']['key']
download_path = '/tmp/{}.gz'.format(key)
csv_path = '/tmp/{}.csv'.format(key)
... proceed to proprietary stuff
이 너무 같은 압축 파일이다 : I는 AWS 람다이 압축 파일을 업로드하고 실행하는 AWS 람다 함수를 구성한
-foo.zip
-foo.py
-dependencies
는 이런 정의 람다 핸들러 기능을 갖는다 foo.handler
. 그러나 테스트 할 때마다 "errorMessage": "Unable to import module 'foo'"
이 나옵니다.
여기에 무슨 일이 일어날 지 모릅니다.
stat --format '%a' foo.py
내가 포스트 그레스와 함께 설치 libpq.so
을 필요로 내 람다 함수,에 psycopg2
을 수입했다, 그래서 664
:
는 감사하게도 누군가는 AWS (λ)와 함께 작동
psycopg2
의 버전을 내장이야? 왜 "메인"람다 모듈을 가져 오길 원하는지 이해가 안됩니다. – stdunbar