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
59
votes
13 answers

How to pass a params from POST to AWS Lambda from Amazon API Gateway

In this question How to pass a querystring or route parameter to AWS Lambda from Amazon API Gateway shows how to map query string params to AWS lambda using API gateway. I would like to do the same but mapping POST values instead of query-string. I…
ecorvo
  • 3,559
  • 4
  • 24
  • 35
58
votes
8 answers

Can bash script be written inside a AWS Lambda function

Can I write a bash script inside a Lambda function? I read in the aws docs that it can execute code written in Python, NodeJS and Java 8. It is mentioned in some documents that it might be possible to use Bash but there is no concrete evidence…
Hardik Kamdar
  • 2,561
  • 4
  • 16
  • 21
57
votes
1 answer

Can I store a temp file on AWS Lambda Function?

I am writing a lambda function for file extraction and need to store a file while performing this function so need to store that file in aws lambda function . Is it possible to store store a file on lambda .
Rahul Panwar
  • 635
  • 1
  • 5
  • 8
57
votes
3 answers

AWS lambda invoke not calling another lambda function - Node.js

After giving all the rights to invoke function. My Lambda function is not able to invoke another function . Every time I am getting timeout having 30 seconds timeout issue. It looks like lambda is not able to get another lambda function My lambdas…
Arpit Vaishnav
  • 4,739
  • 6
  • 39
  • 57
57
votes
4 answers

Connect to ElastiCache cluster from AWS Lambda function

Is it possible to connect from an AWS Lambda function to a Redis ElastiCache cluster? I can't figure out if it's a configuration problem or it's simply not possible. PS: I made a test from an EC2 instance and I can connect to the Redis node. Also…
Mircea Soaica
  • 2,829
  • 1
  • 14
  • 25
56
votes
3 answers

Using boto to invoke lambda functions how do I do so asynchronously?

SO I'm using boto to invoke my lambda functions and test my backend. I want to invoke them asynchronously. I have noted that "invoke_async" is deprecated and should not be used. Instead you should use "invoke" with an InvocationType of "Event" to…
sometimesiwritecode
  • 2,993
  • 7
  • 31
  • 69
56
votes
6 answers

Allow AWS Lambda to access RDS Database

I am trying to connect to RDS Database from an AWS Lambda (Java). Which IP should I enable from the RDS Security group rules?
giò
  • 3,402
  • 7
  • 27
  • 54
56
votes
10 answers

401 return from an API Gateway Custom Authorizer is missing 'Access-Control-Allow-Origin' header

In order to prevent users who have not logged in to call my lambda function through the AWS API Gateway, I'm using the Custom Authorizer lambda solution. If the request is authorized (200) and I get a response from the called lambda everything works…
hanbzu
  • 880
  • 1
  • 8
  • 14
56
votes
5 answers

AWS Lambda: How to store secret to external API?

I'm building a monitoring tool based on AWS Lambda. Given a set of metrics, the Lambdas should be able to send SMS using Twilio API. To be able to use the API, Twilio provide an account SID and an auth token. How and where should I store these…
JonathanGailliez
  • 1,607
  • 2
  • 15
  • 21
55
votes
3 answers

How do you write to the file system of an aws lambda instance?

I am unsuccessfully trying to write to the file system of an aws lambda instance. The docs say that a standard lambda instance has 512mb of space available at /tmp/. However the following code that runs on my local machine isn't working at all on…
Rymnel
  • 4,515
  • 3
  • 27
  • 28
54
votes
1 answer

AWS: Why does my RDS instance keep starting after I turned it off?

I have an RDS database instance on AWS and have turned it off for now. However, every few days it starts up on its own. I don't have any other services running right now. There is this event in my RDS log: "DB instance is being started due to it…
SH10151
  • 954
  • 1
  • 10
  • 17
54
votes
2 answers

how to get return response from AWS Lambda function

I have a simple lambda function that returns a dict response and another lambda function invokes that function and prints the response. lambda function A def handler(event,context): params = event['list'] return {"params" : params +…
user3089927
  • 3,575
  • 8
  • 25
  • 33
54
votes
9 answers

How do I find the API endpoint of a lambda function?

I have a Lambda function that has an exposed API Gateway endpoint, and I can get the URL for that via the AWS console. However, I would like to get that URL via API call. Neither the Lambda API documentation nor the API Gateway documentation seem to…
howcheng
  • 2,211
  • 2
  • 17
  • 24
54
votes
8 answers

How to access HTTP headers for request to AWS API Gateway using Lambda?

I see in the API Gateway FAQ that it is possible to access the request headers sent to the API Gateway... If you already utilize OAuth tokens or any other authorization mechanism, you can easily setup API Gateway not to require signed API calls…
JaredHatfield
  • 6,381
  • 2
  • 29
  • 32
53
votes
4 answers

Fargate vs Lambda, when to use which?

I'm pretty new to the whole Serverless landscape, and am trying to wrap my head around when to use Fargate vs Lambda. I am aware that Fargate is a serverless subset of ECS, and Lambda is serverless as well but driven by events. But I'd like to be…
janDro
  • 1,426
  • 2
  • 11
  • 24