aws-lambda

AWS Lambda Java: Lambda was not able to unzip the file

让人想犯罪 __ 提交于 2020-01-15 07:07:03
问题 I'm trying to use Java with AWS Lambda. I created a jar file with all dependencies (using maven-assembly-plugin). Upon uploading, I cannot call the lambda. I receive the error Calling the Invoke API failed with message: Lambda was not able to unzip the file . The jar file is 11 MB. I can execute the jar with java -jar 回答1: maven-assemply-plugin needs to be told to output a zip , not a jar . (I didn't even know there was a difference!) Add this to its configuration: <plugin> <groupId>org

AWS Lambda Java: Lambda was not able to unzip the file

大城市里の小女人 提交于 2020-01-15 07:06:26
问题 I'm trying to use Java with AWS Lambda. I created a jar file with all dependencies (using maven-assembly-plugin). Upon uploading, I cannot call the lambda. I receive the error Calling the Invoke API failed with message: Lambda was not able to unzip the file . The jar file is 11 MB. I can execute the jar with java -jar 回答1: maven-assemply-plugin needs to be told to output a zip , not a jar . (I didn't even know there was a difference!) Add this to its configuration: <plugin> <groupId>org

How to allow invoking an AWS Lambda function only from EC2 instances inside a VPC

人走茶凉 提交于 2020-01-15 06:50:09
问题 I am struggling with understanding how I can easily invoke my lambda function from an EC2 instance within a VPC. I think I have a quite common problem but strangely enough I didn't found anything specific for this "pattern". I have a Python application in an EC2 instance and I would like to launch heavy processing functions in parallel using Lambda functions and keep the EC2 quite light-weight. Ideally, the Lambda function could be invoked only from within the VPC (only from my EC2 instances)

Amazon Lambda Java function returning png to API gateway [duplicate]

三世轮回 提交于 2020-01-15 04:13:10
问题 This question already has answers here : Returning binary body and http headers from an AWS lambda through API gateway (3 answers) Closed 10 months ago . I have a requirement to return a PNG from an Amazon Lambda Java Function to a Amazon Rest API. I have built the function with a function prototype like this: public static void generatePng(InputStream request, OutputStream response, Context context) The InputStream request details the information that needs to be written into the image. The

How to update all records in DynamoDB?

戏子无情 提交于 2020-01-14 19:53:08
问题 I am new to nosql / DynamoDB. I have a list of ~10 000 container-items records, which is updated every 6 hours: [ { containerId: '1a3z5', items: ['B2a3, Z324, D339, M413'] }, { containerId: '42as1', items: ['YY23, K132'] }, ... ] (primary key = containerId) Is it viable to just delete the table , and recreate with new values? Or should I loop through every item of the new list , and conditionally update/write/delete the current DynamoDB records (using batchwrite)? 回答1: For this scenario batch

Create api-gateway lambda integration using aws-cli

北战南征 提交于 2020-01-14 09:36:06
问题 i need to create an api gateway using aws client. i suucessfully create and integrate with my aws-lambda function using web console. But iam confused with aws-client. These are the steps i followed. create api gateway and integrate with my sample lambda function using web console. Deploy created api and export as json file. Create new api gateway using exported json file using aws-cli. command like this. aws apigateway import-rest-api --body file://tmpfile.json --region us-east-1; But it

How to limit the consuming rate from a topic?

♀尐吖头ヾ 提交于 2020-01-14 08:09:03
问题 Has anyone else solved the following problem? I have SNS topic filled with events from S3 and there is Lambda function which is subscribed on this topic and when thousand of events are put to this topic, lambda function is throttled because of exceeding the limit of concurrency. I don't want to request a limit increase for concurrent executions but I would decrease concurrent consuming from the topic, but I didn't find information how to do it. Thanks. 回答1: A couple of options regarding SNS:

How to limit the consuming rate from a topic?

北慕城南 提交于 2020-01-14 08:08:30
问题 Has anyone else solved the following problem? I have SNS topic filled with events from S3 and there is Lambda function which is subscribed on this topic and when thousand of events are put to this topic, lambda function is throttled because of exceeding the limit of concurrency. I don't want to request a limit increase for concurrent executions but I would decrease concurrent consuming from the topic, but I didn't find information how to do it. Thanks. 回答1: A couple of options regarding SNS:

Invoke Lambda using SNS from Outside Account

丶灬走出姿态 提交于 2020-01-14 08:00:10
问题 I've been following the following blog post from Amazon (Scenario 3: Triggering a Lambda function from an Amazon S3 bucket notification in another account) about authorizing Lambda functions for various uses. I would like to setup a Lambda function to accept SNS messages from external accounts (external to the acct with the lambda function). https://aws.amazon.com/blogs/compute/easy-authorization-of-aws-lambda-functions/ I was expecting to add the permission to invoke the function remotely as

AWS Lambda response in Java for Cognito

我只是一个虾纸丫 提交于 2020-01-14 05:45:26
问题 How can I write an "AWS Lambda response" in Java so that Cognito is happy? Something like this is passed to the lambda function { "version": number, "triggerSource": "string", "region": AWSRegion, "userPoolId": "string", "callerContext": { "awsSdkVersion": "string", "clientId": "string" }, "request": { "userAttributes": { "string": "string", .... } }, "response": {} } Now I need to make the response in Java.. and send back to Cognito. At the moment Cognito throws an