Questions tagged [aws-lambda]

AWS Lambda is a compute service that lets you run code without the overhead of managing servers. (Not to be confused with the [lambda] tag, which instead refers to a type of function).

AWS Lambda is a cloud offering from Amazon Web Services (AWS). AWS Lambda is a serverless compute service that runs code in response to events and automatically manages the underlying infrastructure for you.

Resources

Tutorial

30649 questions
53
votes
7 answers

AWS: how to fix S3 event replacing space with '+' sign in object key names in json

I have a lamba function to copy objects from bucket 'A' to bucket 'B', and everything was working fine, until and object with name 'New Text Document.txt' was created in bucket 'A', the json that gets built in S3 event, key as "key":…
ViS
  • 1,357
  • 1
  • 17
  • 36
53
votes
7 answers

Creating a lambda function in AWS from zip file

I am trying to create a simple lambda function, and I'm running into an error. My code is basically console.log('Loading function'); exports.handler = function(event, context) { console.log('value1 =', event.key1); console.log('value2 =',…
jstnchng
  • 2,161
  • 4
  • 18
  • 31
52
votes
5 answers

Lambda Integration vs. Lambda Proxy: Pros and Cons

What do you think are the Pros and Cons of using Lambda integration with and without the proxy feature in AWS API Gateway (and more specifically, when using the Serverless framework)? Here's what I think up to now: Lambda Integration with…
marcelog
  • 7,062
  • 1
  • 33
  • 46
51
votes
16 answers

error "fork/exec /var/task/main: no such file or directory" while executing aws-lambda function

Getting error fork/exec /var/task/main: no such file or directory while executing lambda function. I am using windows platform to run and build code in Go. I have done following steps to deploy go aws-lambda handler: Written code in go language…
Pooja K Bhatt
  • 979
  • 2
  • 10
  • 18
51
votes
3 answers

How could I use aws lambda to write file to s3 (python)?

I have tried to use lambda function to write a file to S3, then test shows "succeeded" ,but nothing appeared in my S3 bucket. What happened? Does anyone can give me some advice or solutions? Thanks a lot. Here's my code. import json import…
50
votes
2 answers

How get Environment Variables from lambda (nodejs aws-sdk)

We can set up Environment Variables in aws-lambda for example via AWS SAM: Environment: Variables: TABLE_NAME: !Ref Table How can I get this variables from current lambda via Node JS AWS-SDK?
Max Vinogradov
  • 1,343
  • 1
  • 13
  • 31
49
votes
8 answers

How to test AWS Lambda handler locally using NodeJS?

I am following these instructions to create a basic web scraper that executes in Lambda. I have experience writing selenium code, but not with Node JS. I got the project running in Lambda, but when I tried editing the project locally in order to…
kroe761
  • 3,296
  • 9
  • 52
  • 81
49
votes
3 answers

Setting http response header from AWS lambda

My API Gateway/Lambda setup returns an HTTP response header: Lambda uses callback function to return the value as part of a JSON and the Integration Response maps it into a HTTP header (using integration.response.body) With this solution, the values…
Saar
  • 1,753
  • 6
  • 20
  • 32
49
votes
6 answers

API Gateway - POST multipart/form-data

It seems my question maybe a little similar to this one. I have an API within my API Gateway and am doing a HTTP proxy through to an endpoint that POST's multipart/form-data files. If I call the HTTP endpoint directly (not through the API gateway) -…
Hexie
  • 3,955
  • 6
  • 32
  • 55
49
votes
3 answers

AWS: Publish SNS message for Lambda function via boto3 (Python2)

I am trying to publish to an SNS topic which will then notify a Lambda function, as well as an SQS queue. My Lambda function does get called, but the CloudWatch logs state that my "event" object is None. The boto3 docs states to use the kwarg…
bmoran
  • 1,499
  • 2
  • 13
  • 21
49
votes
6 answers

aws lambda function triggering multiple times for a single event

I am using aws lambda function to convert uploaded wav file in a bucket to mp3 format and later move file to another bucket. It is working correctly. But there's a problem with triggering. When i upload small wav files,lambda function is called…
Ijas Ahamed N
  • 5,632
  • 5
  • 31
  • 53
48
votes
6 answers

Index handler is undefined or not exported

I have a lambda function which was working fine but I wanted to import a package so I created a directory with index.js and installed my npm package. Then created a zip of this folder and uploaded it using aws lambda update-function-code…
Anshul Walia
  • 547
  • 1
  • 5
  • 9
48
votes
13 answers

How to increase the maximum size of the AWS lambda deployment package (RequestEntityTooLargeException)?

I upload my lambda function sources from AWS codebuild. My Python script uses NLTK so it needs a lot of data. My .zip package is too big and an RequestEntityTooLargeException occurs. I want to know how to increase the size of the deployment package…
Louis Singer
  • 767
  • 1
  • 9
  • 18
48
votes
12 answers

Execution failed due to configuration error: Invalid permissions on Lambda function

I am building a serverless application using AWS Lambda and API Gateway via Visual Studio. I am working in C#, and using the serverless application model (SAM) in order to deploy my API. I build the code in Visual Studio, then deploy via publish to…
JamesMatson
  • 2,522
  • 2
  • 37
  • 86
48
votes
14 answers

aws-lambda Cannot find module

I keep getting this error in the aws-lambda console when uploading code from a zip file. I have tried uploading other zip files and they work correctly. The .js file is named "CreateThumbnail.js" in the zip file. I believe the handler is also named…
Daniel Munoz
  • 481
  • 1
  • 4
  • 3