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
498
votes
23 answers

How to pass a querystring or route parameter to AWS Lambda from Amazon API Gateway

for instance if we want to use GET /user?name=bob or GET /user/bob How would you pass both of these examples as a parameter to the Lambda function? I saw something about setting a "mapped from" in the documentation, but I can't find that setting in…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
452
votes
21 answers

Can an AWS Lambda function call another

I have 2 Lambda functions - one that produces a quote and one that turns a quote into an order. I'd like the Order lambda function to call the Quote function to regenerate the quote, rather than just receive it from an untrusted client. I've looked…
Silver
  • 4,911
  • 3
  • 15
  • 16
293
votes
5 answers

Download an already uploaded Lambda function

I created a lambda function in AWS (Python) using "upload .zip" I lost those files and I need to make some changes, is there is any way to download that .zip?
Elheni Mokhles
  • 3,801
  • 2
  • 12
  • 17
246
votes
9 answers

How to load npm modules in AWS Lambda?

I've created several Lambda functions using the web based editor. So far so good. I'd now like to start extending those with modules (such as Q for promises). I can't figure out how to get the modules out to Lambda so they can be consumed by my…
Fook
  • 5,320
  • 7
  • 35
  • 57
173
votes
12 answers

The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2

When I input any code in this function (e.g. console.log();) and click "Save", an error occurs: The provided execution role does not have permissions to call DescribeNetworkInterfaces on EC2 exports.handler = (event, context, callback) => { …
fish
  • 2,173
  • 2
  • 13
  • 18
172
votes
16 answers

AWS Lambda Scheduled Tasks

Amazon announced AWS Lambda (http://aws.amazon.com/lambda/). The product description includes: Scheduled Tasks AWS Lambda functions can be triggered by external event timers, so functions can be run during regularly scheduled maintenance times…
Nathan H
  • 48,033
  • 60
  • 165
  • 247
170
votes
32 answers

AWS error from Python: No module named lambda_function

I am creating a AWS Lambda python deployment package. I am using one external dependency requests. I installed the external dependency using the AWS documentation. Below is my Python code. import requests print('Loading function') s3 =…
Nithin
  • 9,661
  • 14
  • 44
  • 67
146
votes
11 answers

Using python Logging with AWS Lambda

As the AWS documentation suggests: import logging logger = logging.getLogger() logger.setLevel(logging.INFO) def my_logging_handler(event, context): logger.info('got event{}'.format(event)) logger.error('something went wrong') Now I…
p.magalhaes
  • 7,595
  • 10
  • 53
  • 108
136
votes
19 answers

AWS lambda api gateway error "Malformed Lambda proxy response"

I am trying to set up a hello world example with AWS lambda and serving it through api gateway. I clicked the "Create a Lambda Function", which set up the api gatway and selected the Blank Function option. I added the lambda function found on AWS…
jjbskir
  • 8,474
  • 9
  • 40
  • 53
136
votes
6 answers

Getting json body in aws Lambda via API gateway

I'm currently using NodeJS to build a bot on AWS lambda via AWS Api Gateway and I'm running into an issue with POST requests and JSON data. My api uses 'Use Lambda Proxy integration' and even when I test the proxy sending a content-type of…
TommyBs
  • 9,354
  • 4
  • 34
  • 65
127
votes
4 answers

Error "Read-only file system" in AWS Lambda when downloading a file from S3

I'm seeing the below error from my lambda function when I drop a file.csv into an S3 bucket. The file is not large and I even added a 60 second sleep prior to opening the file for reading, but for some reason the file has the extra ".6CEdFe7C"…
user1530318
  • 25,507
  • 15
  • 37
  • 48
126
votes
9 answers

AccessDeniedException: User is not authorized to perform: lambda:InvokeFunction

I'm trying to invoke a lambda function from node. var aws = require('aws-sdk'); var lambda = new aws.Lambda({ accessKeyId: 'id', secretAccessKey: 'key', region: 'us-west-2' }); lambda.invoke({ FunctionName: 'test1', Payload:…
Arjun Komath
  • 2,802
  • 4
  • 16
  • 24
121
votes
12 answers

Using an API key in Amazon API Gateway

I have created an API Key and added it to my functions. I have then deployed the api and tested it but still get: "message": "Forbidden" How do I pass the api key with my JSON request as I have been using "x-api-key": "theKey"?
cdub
  • 24,555
  • 57
  • 174
  • 303
121
votes
12 answers

Is there a way to change the http status codes returned by Amazon API Gateway?

For instance if I want to return a specific 400 error for invalid parameters or perhaps a 201 when the lambda function call resulted in a create. I'd like to have different http status codes but it looks like api gateway always returns a 200 status…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
114
votes
4 answers

Is it possible to rename an AWS Lambda function?

I have created some AWS Lambda functions for testing purposes (named as test_function something), then after testing I found those functions can be used in prod environment. Is it possible to rename the AWS Lambda function? and how? Or should I…
Sabrina Luo
  • 3,810
  • 4
  • 16
  • 35
1
2 3
99 100