aws-lambda-layers

Unable to import modules from aws lambda layer

故事扮演 提交于 2020-06-17 08:06:40
问题 I have a requirements file for my pip packages. I installed it in a target folder and zipped the contents and uploaded it on AWS lambda layer. Requirements.txt asgiref==3.2.3 certifi==2019.11.28 chardet==3.0.4 cloudevents==0.2.4 decorator==4.4.1 Django==3.0 idna==2.8 jaeger-client==4.2.0 jsonpath-ng==1.4.3 pbr==5.4.4 ply==3.11 pytz==2019.3 requests==2.22.0 six==1.13.0 sqlparse==0.3.0 urllib3==1.25.7 aws-xray-sdk mysql-connector-python gunicorn I used the command pip3 install -r requirements

pysftp library not working in AWS lambda layer

橙三吉。 提交于 2020-06-11 06:01:12
问题 I want to upload files to EC2 instance using pysftp library (Python script). So I have created small Python script which is using below line to connect pysftp.Connection( host=Constants.MY_HOST_NAME, username=Constants.MY_EC2_INSTANCE_USERNAME, private_key="./mypemfilelocation.pem", ) some code here ..... pysftp.put(file_to_be_upload, ec2_remote_file_path) This script will upload files from my local Windows machine to EC2 instance using .pem file and it works correctly. Now I want to do this

pysftp library not working in AWS lambda layer

浪子不回头ぞ 提交于 2020-06-11 05:58:10
问题 I want to upload files to EC2 instance using pysftp library (Python script). So I have created small Python script which is using below line to connect pysftp.Connection( host=Constants.MY_HOST_NAME, username=Constants.MY_EC2_INSTANCE_USERNAME, private_key="./mypemfilelocation.pem", ) some code here ..... pysftp.put(file_to_be_upload, ec2_remote_file_path) This script will upload files from my local Windows machine to EC2 instance using .pem file and it works correctly. Now I want to do this

Can I import typescript types from a Lambda Layer?

泪湿孤枕 提交于 2020-01-14 14:22:07
问题 I am attempting to use TypeScript when building Lambda functions but hitting an issue when using a Lambda Layer which is also written in TypeScript. TypeScript does not recognise the /opt/nodejs/... import for my Layer (as it would running in SAM or AWS) and therefore I am unable to import types which I have defined in the Layer to my Lambda function. I have tried looking to see if I am able to somehow npm link the layer but I can't seem to get that working because the import is a local path

Import libraries in lambda layers

爷,独闯天下 提交于 2019-12-21 17:52:27
问题 I wanted to import jsonschema library in my AWS Lambda in order to perform request validation. Instead of bundling the dependency with my app , I am looking to do this via Lambda Layers. I zipped all the dependencies under venv/lib/python3.6/site-packages/ . I uploaded this as a lambda layer and added it to my aws lambda using publish-layer-version and aws lambda update-function-configuration commands respectively. The zip folder is name "lambda-dep.zip" and all the files are under it.

Unable to import module 'lambda_function': No module named 'pandas'

非 Y 不嫁゛ 提交于 2019-12-19 02:54:11
问题 START RequestId: 3d5691d9-ad79-4eed-a26c-5bc3f1a23a99 Version: $LATEST Unable to import module 'lambda_function': No module named 'pandas' END RequestId: 3d5691d9-ad79-4eed-a26c-5bc3f1a23a99 I'm using Windows 7 64-bit as the host OS. What I want to do I simply want to use pandas in AWS-Lambda environment. Just like I use it in windows environment, I am looking for a simple solution for Lambda. What I have tried so far Installed Xubuntu on a virtual box. Create a virtual environment called

libtensorflow.so: cannot open shared object file: No such file or directory

匆匆过客 提交于 2019-12-06 05:16:29
问题 I have created an AWS Lambda Layer using following command: aws lambda publish-layer-version --layer-name TensorflowLambdaLayer --compatible-runtimes go1.x --zip-file fileb://tensorflowLayer.zip Here is ARN that was generated: `arn:aws:lambda:us-east-1:757767972066:layer:TensorflowLambdaLayer:1 When I try to run my Lambda function which uses Tesnroflow library via AWS SAM, it gets stuck on "mounting" step: 2019-07-18 15:51:29 Mounting /tmp/tmpgz8cb80s as /var/task:ro,delegated inside runtime

Unable to import module 'lambda_function': No module named 'pandas'

泪湿孤枕 提交于 2019-12-05 08:22:57
START RequestId: 3d5691d9-ad79-4eed-a26c-5bc3f1a23a99 Version: $LATEST Unable to import module 'lambda_function': No module named 'pandas' END RequestId: 3d5691d9-ad79-4eed-a26c-5bc3f1a23a99 I'm using Windows 7 64-bit as the host OS. What I want to do I simply want to use pandas in AWS-Lambda environment. Just like I use it in windows environment, I am looking for a simple solution for Lambda. What I have tried so far Installed Xubuntu on a virtual box. Create a virtual environment called myvenv in Xubuntu on virtual-box. Then I installed pandas3.6 in myvenv . Thereafter, I copied the folder