aws-lambda

If a AWS Lambda function has event sources from multiple Kinesis streams, will the batch of incoming records be from a single Kinesis stream or a mix?

浪尽此生 提交于 2019-12-19 03:20:22
问题 The title might be a bit confusing. I'll try my best to make it clearer. Suppose I have a AWS Lambda function that has two different Kinesis streams A and B as input event sources. So, for the below, since a KinesisEvent instance contains a batch of records, will the batch contain records from a single stream, or essentially it contain records from both streams A and B? public class ProcessKinesisEvents { public void recordHandler(KinesisEvent event, Context context) { ... } } 回答1: Each

Why does the first Firebase call from the server take much longer to return than subsequent calls?

痞子三分冷 提交于 2019-12-19 03:13:47
问题 Problem First call to Firebase from a server takes ~15 - 20X longer than subsequent calls. While this is not a problem for a conventional server calling upon Firebase, it may cause issues with a server-less architecture leveraging Amazon Lambda/ Google Cloud Functions. Questions Why is the first call so much slower? Is it due to authentication? Are there any workarounds? Is it practical to do some user-initiated computation of data on Firebase DB using Amazon Lambda/ Google Cloud Functions

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

AWS Lambda error on Cognito User Pool trigger

拜拜、爱过 提交于 2019-12-19 02:49:17
问题 I'm trying to insert a record into DynamoDB invoking "Pre sign-up" trigger of Cognito User Pool. Lambda function is pretty simple for testing purposes but there is always an error in client application on AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool.signUp call Use case 1 Lambda body: console.log('Received event:', JSON.stringify(event, null, 2)); Result: InvalidLambdaResponseException: Invalid lambda function output : Invalid JSON Use case 2 Lambda body: callback("null",

How to let AWS lambda in a VPC to publish SNS notification?

瘦欲@ 提交于 2019-12-18 18:53:10
问题 I have a lambda function that accesses my Postgres db in RDS via VPC. After it queries the db, I want to post a notification to SNS. Because my lambda function exists in my VPC, it cannot access SNS. I have an internet gateway on my VPC. I read through the VPC endpoint documentation and currently only s3 is supported. Is there anyway to publish to SNS in a lambda function in a VPC? 回答1: You will need a NAT server running in your VPC to route traffic outside of the VPC. AWS now offers a

Can't get phantomjs to work on aws lambda

£可爱£侵袭症+ 提交于 2019-12-18 17:22:29
问题 I'm trying to execute phantomjs using node-lambda and bits and pieces I found on the web mainly https://github.com/justengland/phantom-lambda-template I had some problems deploying node-lambda with node43 but manually installing the latest source seems to have helped in that regard. but now I'm having trouble running the lambda functions. I get 2016-04-12T16:47:12.133Z 3330adb9-00ce-11e6-9c08-d79a6bc84748 Calling phantom: /var/task/phantomjs [ '/var/task/phantomjs-script.js' ] 2016-04-12T16

Can't trigger lambda's on SQS FIFO

China☆狼群 提交于 2019-12-18 14:00:55
问题 I am trying to trigger lambda execution to execute an item on a FIFO queue. Other than polling, what options do we have to accomplish that? We just learned that we cannot directly trigger a lambda execution from a FIFO queue, which is only supported from the standard queue at this time. I also learned that we cannot subscribe an SNS topic to a FIFO queue – which is only supported on the standard queue as well. Has anybody found a work around for this yet until Amazon releases an update? 回答1:

How we can use JDBC connection pooling with AWS Lambda?

自作多情 提交于 2019-12-18 13:06:14
问题 Can we use JDBC connection pooling with AWS Lambda ? AS AWS lambda function get called on a specific event, so its life time persist even after it finishing one of its call ? 回答1: No. Technically, you could create a connection pool outside of the handler function but since you can only make use of any one single connection per invocation so all you would be doing is tying up database connections and allocating a pool of which you could only ever use 1. After uploading your Lambda function to

AWS lambda and Java concurrency

安稳与你 提交于 2019-12-18 10:32:21
问题 It is known that AWS lambda may reuse early created objects of handlers, and it really does it (see FAQ): Q: Will AWS Lambda reuse function instances? To improve performance, AWS Lambda may choose to retain an instance of your function and reuse it to serve a subsequent request, rather than creating a new copy. Your code should not assume that this will always happen. The question is regarding Java concurrency. If I have a class for a handler, say: public class MyHandler { private Foo foo;

How to process SQS queue with lambda function (not via scheduled events)?

佐手、 提交于 2019-12-18 10:03:09
问题 Here is the simplified scheme I am trying to make work: http requests --> (Gateway API + lambda A) --> SQS --> (lambda B ?????) --> DynamoDB So it should work as shown: data coming from many http requests (up to 500 per second, for example) is placed into SQS queue by my lambda function A. Then the other function, B, processes the queue: reads up to 10 items (on some periodical basis) and writes them to DynamoDB with BatchWriteItem. The problem is that I can't figure out how to trigger the