aws-lambda

Which NPM modules are preinstalled in AWS Lambda execution environment?

时光总嘲笑我的痴心妄想 提交于 2020-06-22 10:11:23
问题 Recently I found that aws-sdk NPM module is preinstalled in AWS Lambda nodejs8.10. And I can't find any information in the internet about it. Which other node.js modules are pre-installed in AWS Lambda? 回答1: Only the aws-sdk package is preinstalled . All the rest is loaded from the "node_modules" directory.. You can find information about it here: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-create-deployment-pkg.html 回答2: I've used the "https" and the "url" package, so those at least

Which NPM modules are preinstalled in AWS Lambda execution environment?

主宰稳场 提交于 2020-06-22 10:09:06
问题 Recently I found that aws-sdk NPM module is preinstalled in AWS Lambda nodejs8.10. And I can't find any information in the internet about it. Which other node.js modules are pre-installed in AWS Lambda? 回答1: Only the aws-sdk package is preinstalled . All the rest is loaded from the "node_modules" directory.. You can find information about it here: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-create-deployment-pkg.html 回答2: I've used the "https" and the "url" package, so those at least

Mocking two S3 API calls in the same AWS Lambda function using Jest

你。 提交于 2020-06-17 14:10:49
问题 I'm trying to mock two S3 calls in the same Lambda function but seem to be getting Access Denied errors so this leads me to believe the S3 calls are not being mocked. The syntax I'm currently using works when mocking just one S3 call in the function but the function I'm currently testing has two S3 calls(deleteObject and putObject). Here is my mock code: const putObjectMock = jest.fn(() => ({ promise: jest.fn(), })); const deleteObjectMock = jest.fn(() => ({ promise: jest.fn(), }))); jest

Unable to import modules from aws lambda layer

佐手、 提交于 2020-06-17 08:08: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

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

Achieve the parallelism for these distributed tasks handling with AWS

半世苍凉 提交于 2020-06-17 08:05:49
问题 While developing an infra on aws having certain questions and issues I am facing with it. I want to parallelism distributed tasks handling for API. Scenario- I have an app that is related to banking where every minute millions of requests generate for scheduling reports. Report are of several types. Like say Account report, Transaction report, and so on. which can be further schedule daily, weekly, monthly or custom. It should be send using email and report attach to email. Now what I require

Achieve the parallelism for these distributed tasks handling with AWS

北城以北 提交于 2020-06-17 08:05:20
问题 While developing an infra on aws having certain questions and issues I am facing with it. I want to parallelism distributed tasks handling for API. Scenario- I have an app that is related to banking where every minute millions of requests generate for scheduling reports. Report are of several types. Like say Account report, Transaction report, and so on. which can be further schedule daily, weekly, monthly or custom. It should be send using email and report attach to email. Now what I require

AWS CDK how to create an API Gateway backed by Lambda from OpenApi spec?

大兔子大兔子 提交于 2020-06-17 02:07:13
问题 I want to use AWS CDK to define an API Gateway and a lambda that the APIG will proxy to. The OpenAPI spec supports a x-amazon-apigateway-integration custom extension to the Swagger spec (detailed here), for which an invocation URL of the lambda is required. If the lambda is defined in the same stack as the API, I don't see how to provide this in the OpenAPI spec. The best I can think of would be to define one stack with the lambda in, then get the output from this and run sed to do a find-and

AWS CDK how to create an API Gateway backed by Lambda from OpenApi spec?

耗尽温柔 提交于 2020-06-17 02:05:11
问题 I want to use AWS CDK to define an API Gateway and a lambda that the APIG will proxy to. The OpenAPI spec supports a x-amazon-apigateway-integration custom extension to the Swagger spec (detailed here), for which an invocation URL of the lambda is required. If the lambda is defined in the same stack as the API, I don't see how to provide this in the OpenAPI spec. The best I can think of would be to define one stack with the lambda in, then get the output from this and run sed to do a find-and

Is SES the only way to send email from Lambda?

萝らか妹 提交于 2020-06-17 01:46:27
问题 I am trying to use my company's mailhost for sending email to internal mail groups but I am unable to send an email. It throws exception as below: "javax.mail.MessagingException: 501 5.0.0 HELO requires domain address at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1363)" Is it a limitation or I need to use SES only for sending emails? Is there any configuration that I need to do and I might have missed? Anything to check in VPC if the ports are open? Should I use port