aws-lambda

Uploading screenshot from AWS lambda to s3 bucket fails

家住魔仙堡 提交于 2019-12-13 06:19:40
问题 I am trying to take screenshots with puppeteer on aws lambda and upload the screenshot to a s3 bucket. However, the s3.putObject method doesn't seem to be working. On the lambda console, I got both the "uploading screenshot 's3://${s3bucket}/${filename}'" and "uploading completed" message but not the "inside callback" message. The weird thing is, I got no error during the lambda execution, but I just couldn't get the message inside the putObject method and couldn't find the screenshots in the

AWS lambda update-function-code with jar package via AWS CLI

与世无争的帅哥 提交于 2019-12-13 04:45:32
问题 I'm trying to update my lambda function code with jar from my local machine via AWS CLI. The aws lambda has commands to update function code for zip file but not for jar. I can upload by using s3 bucket, but I need to update from local itself. I know following are the way to update from S3 bucket and for zip: aws lambda update-function-code --function-name --s3-bucket --s3-key aws lambda update-function-code --function-name --zip-file "fileb://" I want to ask is there similar command exist

python-lambda: 'lambda' is not recognized as an internal or external command, operable program or batch file

百般思念 提交于 2019-12-13 04:34:14
问题 I am unable to install the lambda command using python-lambda. I did the following: pip install python-lambda and can confirm that it is available in my site-packages folder of my virtual environment. Nevertheless, when I write lambda init it returns: 'lambda' is not recognized as an internal or external command, operable program or batch file. How can I get this working? 回答1: If you're looking for the lambda I think you are, that package comes pre-installed. Try running some example code

Sending SES email from AWS Lambda - Node JS Error “Cannot find module 'nodemailer”

六月ゝ 毕业季﹏ 提交于 2019-12-13 04:29:56
问题 I have this error message: "errorMessage": "Cannot find module 'nodemailer'" I Googled, and it says install nodemailer. Can someone tell me where exactly do I install this module? I am new to Lambda. My Lambda function is below : var aws = require("aws-sdk"); var nodemailer = require("nodemailer"); var ses = new aws.SES(); var s3 = new aws.S3(); exports.handler = (event, context, callback) => { callback(null, 'Hello from Lambda'); }; 回答1: You'll have to initialize your project locally npm

How does Tinder know who's been seen? (Backend)

我们两清 提交于 2019-12-13 04:27:56
问题 I have a dynamodb source of models. Now I query them via ElasticSearch, so I can make a geo search. give me all models in 30 km circle. Now the user has a Tinder system. So can wipe. How do I know which models I don't have to retrieve anymore? What is the best way to do this? A table with already seen maps? Then I subtract from ElasticSearch, get an array with 100 cards and compare them? If he has already seen all 100, then ask ElasticSearch again? That makes little sense. The more the user

Adding PermissionBoundary fails in SAM template

给你一囗甜甜゛ 提交于 2019-12-13 04:26:08
问题 Below is the SAM template: Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: hello-world/ Handler: app.LambdaHandler Runtime: nodejs8.10 Events: MySQSEvent: Type: SQS Properties: Queue: !GetAtt SomeQueue.Arn BatchSize: 10 PermissionsBoundary: "arn:aws:iam::${AWS::AccountId}:policy/AddPermission" SomeQueue: Type: AWS::SQS::Queue AddPermission: Type: AWS::IAM::ManagedPolicy Properties: PolicyDocument: Version: 2012-10-17 Statement: - Sid:

Shared Libraries in Java AWS Lambda Project

孤街浪徒 提交于 2019-12-13 04:25:34
问题 In my java class System.loadLibrary() is not able to locate the library files. I have used Gradle build to zip file in below structure: zip mypackage App.class GatewayResponse.class lib set of jars and shared libraries Lambda service is able to load my jar but not libraries. Imagine example.jar and libExample.so are part of my lib directory. From App class: I have created an object of some class in the example.jar and it works fine. when I try to load the library libExample.so using system

Parse the List of objects in AWS Connect

回眸只為那壹抹淺笑 提交于 2019-12-13 03:57:17
问题 AWS lambda returns the below List. How can I parse the List in AWS Connect? In AWS Connect, if lambda returns a single attribute (customerId) I can parse that value in Connect using $.External.customerId and was able to play that CustomerId. If Lamda returns the below List, I was accessing in connect as: $.External.list.CustomerId and it fails. No errors n Cloudwatch Logs. Any idea how to parse the below list in Connect? AWS lambda returns the below List. How can I parse the List in AWS

FFMPEG- AWS Lambda Function Issue

眉间皱痕 提交于 2019-12-13 03:56:11
问题 I have created a aws lamda function with node js fluent-ffmpeg so in this use ffmpeg and ffprob for use create a video , scaling and converting video using serverless application. where aws lambda deployment package created more than 50 mb because i am using with the help of ffmpeg and ffprob exe (binary library). so i can not upload a deployment zip file. can do with any solution,please help me. 回答1: You can use new AWS Lambda called Layers. It allows you to include some custom artifacts,

How to access additional AWS resources from within an Amplify generated Lambda function?

浪尽此生 提交于 2019-12-13 03:55:55
问题 I've been playing around with AWS Amplify. Being relatively new to AWS I'm a huge fan of how Amplify provisions the necessary resources and IAM roles on AWS for me. My question is in regards to using Lambda with GraphQL. Following the documentation I'm able to create a custom GraphQL query that calls a Lambda function and returns a GraphQL response. However, I can't find anywhere in the documentation on how to interact with other AWS resources from within this Lambda function. For example, I