aws-lambda

AWS Lambda + Python-ldap

回眸只為那壹抹淺笑 提交于 2021-02-19 03:54:40
问题 I am trying to use python-ldap with AWS Lambda. I downloaded the tarball from : https://pypi.python.org/pypi/python-ldap and code to use lambda (lambda_function.py) from ldap_dir.ldap_query.Lib import ldap and uploaded the zip to Lambda. where my directory structure is ldap_dir -> ldap_query -> Lib -> ldap folder ldap_dir -> lambda_function.py Am I missing out something? 回答1: python-ldap is built on top of native OpenLDAP libraries. This article - even though unrelated to the python ldap

Access to aws-lambda context when running nodejs + expressjs

柔情痞子 提交于 2021-02-18 22:50:02
问题 I'm, just starting out with AWS-Lambda, AWS-API Gateway and ExpressJs. I'm having trouble finding how the AWS-Lambda "context" is available in my "ExpressJs" application. I'm using: AWS-Lambda AWS-API Gateway NodeJs v4.3.2 ExpressJs 4.14.1 ClaudiaJs 2.7.0 In Aws Lambda I use aws-serverless-express to receive the API-Gateway request and initialize the node application. The following is the structure I have found from different tutorials, etc lambda.js (Initiated from API-Gateway. Supplying the

Access to aws-lambda context when running nodejs + expressjs

南笙酒味 提交于 2021-02-18 22:49:45
问题 I'm, just starting out with AWS-Lambda, AWS-API Gateway and ExpressJs. I'm having trouble finding how the AWS-Lambda "context" is available in my "ExpressJs" application. I'm using: AWS-Lambda AWS-API Gateway NodeJs v4.3.2 ExpressJs 4.14.1 ClaudiaJs 2.7.0 In Aws Lambda I use aws-serverless-express to receive the API-Gateway request and initialize the node application. The following is the structure I have found from different tutorials, etc lambda.js (Initiated from API-Gateway. Supplying the

Write to S3 bucket using Async/Await in AWS Lambda

允我心安 提交于 2021-02-18 21:12:07
问题 I have been using the code below (which I have now added await to) to send files to S3. It has worked fine with my lambda code but as I move to transfer larger files like MP4 I feel I need async/await. How can I fully convert this to async/await? exports.handler = async (event, context, callback) => { ... // Copy data to a variable to enable write to S3 Bucket var result = response.audioContent; console.log('Result contents ', result); // Set S3 bucket details and put MP3 file into S3 bucket

Accessing Parameter Store from VPC / Lambda

依然范特西╮ 提交于 2021-02-18 11:45:14
问题 My lambda function can access Systems Manager parameters (ssm.getParameter) when NOT in a VPC. When I add the lambda function to my VPC, I lose access to SSM. The function times out. Clearly I am missing a security group setting or something but can't figure it out. What do I need to do to enable lambda access to SSM when running it in my VPC? 回答1: Most likely this is because you're creating your lambda function in the public subnet, Lambda does get public ip address and uses NAT to access

Trigger Lambda Function in AWS when the message is present in SQS Queue

落爺英雄遲暮 提交于 2021-02-18 06:59:13
问题 I am using AWS Lambda function to process the messages in Queue it's working fine. But i need to execute this Lambda function when messages available or added in SQS queue. Is it possible to trigger the Lambda function based on SQS queue.Please suggest one method to achieve this goal. 回答1: Invoking Lambda functions from SQS queues is not directly supported. You can see the list of available triggers here: http://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html Possible

API Gateway POST method working during tests, but not with postman

百般思念 提交于 2021-02-18 02:31:54
问题 i will try to explain my problem clearly. I have an API who writes something in DynamoDB with a lambda function written in Node.js. When i'm calling it within the AWS console, the API works as expected. I send a body like that: { "user-id":"4dz545zd", "name":"Bush", "firstname":"Gerard", } And that creates the entry within my dynamoDB table. But when i call the same API (freshly deployed) with Postman, i get this error: { "statusCode": "400", "body": "One or more parameter values were invalid

API Gateway POST method working during tests, but not with postman

核能气质少年 提交于 2021-02-18 02:29:50
问题 i will try to explain my problem clearly. I have an API who writes something in DynamoDB with a lambda function written in Node.js. When i'm calling it within the AWS console, the API works as expected. I send a body like that: { "user-id":"4dz545zd", "name":"Bush", "firstname":"Gerard", } And that creates the entry within my dynamoDB table. But when i call the same API (freshly deployed) with Postman, i get this error: { "statusCode": "400", "body": "One or more parameter values were invalid

CrawlerRunner not crawl pages with Crochet

。_饼干妹妹 提交于 2021-02-17 07:04:07
问题 I am trying to launch a Scrapy from script with CrawlerRunner() to launch in AWS Lambda. I watched in Stackoverflow the solution with crochet library, but it doesn´t work for me. Links: StackOverflow 1 StackOverflow 2 This is the code: import scrapy from scrapy.crawler import CrawlerRunner from scrapy.utils.project import get_project_settings from scrapy.utils.log import configure_logging # From response in Stackoverflow: https://stackoverflow.com/questions/41495052/scrapy-reactor-not

Does AWS Lambda Store Last Run Time?

Deadly 提交于 2021-02-17 03:25:13
问题 I am trying to pass a unix timestamp into API get request as a parameter to another system to grab data. The parameter needs to be the last time the AWS Lambda ran. I need to somehow store the last time the AWS lambda function has ran into maybe an s3 bucket and also recover that timestamp. So I can pass that value along into the next run. Anyone have any ideas on how to do something like this? 回答1: Lambda does not store any last run time between invocations (especially as its possible there