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
47
votes
10 answers

Restarting AWS lambda function to clear cache

I have a AWS Lambda function that creates an object from a s3 call in cold start. I then hold the object in the cache while the function is warm to keep load times down. When files are changed in s3, I have a trigger to run the lambda, but not all…
Marc
  • 473
  • 1
  • 4
  • 4
47
votes
5 answers

Lambda@Edge not logging on cloudfront request

As explained in the Docs , I set up Lambda@edge for cloudfront trigger of Viewer Response. The lambda function code : 'use strict'; exports.handler = (event, context, callback) => { console.log('----EXECUTED------'); const response =…
47
votes
4 answers

How to point ApiGateway to a specific Lambda alias

I created a resource in Amazon's ApiGateway. It is pointing to a Lambda function. This is being hit by a native mobile application (android and ios) which is already in the wild. I now want to modify the Lambda function, but I see no way to change…
digitaljoel
  • 26,265
  • 15
  • 89
  • 115
47
votes
2 answers

Adding AWS Lambda with VPC configuration causes timeout when accessing S3

I am trying to access S3 and resources on my VPC from AWS Lambda but since I configured my AWS Lambda to access VPC it's timing out when accessing S3. Here's the code from __future__ import print_function import boto3 import logging import…
Chenna V
  • 10,185
  • 11
  • 77
  • 104
46
votes
11 answers

S3 Bucket Lambda Event: Unable to validate the following destination configurations

I'm trying to create an S3 bucket and immediately assign a lambda notification event to it. Here's the node test script I wrote: const aws = require('aws-sdk'); const uuidv4 = require('uuid/v4'); aws.config.update({ accessKeyId: 'key', …
Scotty Waggoner
  • 3,083
  • 2
  • 26
  • 40
46
votes
2 answers

Accessing local filesystem in AWS lambda

Is it possible to access local filesystem in a AWS lambda function? If so, is there any downside to doing so?
SquareRoot
  • 463
  • 1
  • 4
  • 4
46
votes
6 answers

Error executing "Hello World" for AWS Lambda in Java

I have written following Hello World Lambda which I am executing by uploading on AWS via AWS toolkit for Eclipse. public class HelloWorldLambdaHandler implements RequestHandler { public String handleRequest(String input, Context…
Hemant
  • 4,537
  • 8
  • 41
  • 43
45
votes
10 answers

AWS Lambda - How to stop retries when there is a failure

I know that when a Lambda function fails (for example when there is a time out), it tries to run the function 3 more times again. Is there any way to avoid this behavior? I' have been reading the documentation, but didn't find anyting about…
AleGallagher
  • 1,745
  • 7
  • 30
  • 40
45
votes
6 answers

How to use Dependency Injection in AWS Lambda C# implementation

I have created Lambda functions using AWS.Net SDK, .net core version 1.0. I want to implement dependency injection. Since lambda functions triggered and run independently in AWS environment, there is no such class like Startup present. How and Where…
Yaduraj
  • 605
  • 1
  • 7
  • 11
45
votes
4 answers

How to return the inserted item in dynamoDB

I am using nodeJS sdk to put the item to dynamoDB, The item is: { "eventId": date + '-' + eventName + '-' + eventPurpose, "eventName": eventName, "eventPurpose": eventPurpose, "eventDates": eventDates, "attendees": attendees } The…
45
votes
6 answers

AWS lambda function stops working after timed out error

I have a simple lambda function that asynchronously makes an API calls and then returns data. 99% of the time this works great. When ever the API takes longer then the lambda configured timeout, it gives an error as expected. Now the issue is that…
jjbskir
  • 8,474
  • 9
  • 40
  • 53
45
votes
2 answers

Reading data from S3 using Lambda

I have a range of json files stored in an S3 bucket on AWS. I wish to use AWS lambda python service to parse this json and send the parsed results to an AWS RDS MySQL database. I have a stable python script for doing the parsing and writing to the…
LearningSlowly
  • 8,641
  • 19
  • 55
  • 78
45
votes
4 answers

can AWS Lambda connect to RDS mySQL database and update the database?

I am trying to connect AWS Lambda function to RDS mysql database. I just wanted to update the database from my lambda function. Is it possible to access RDS by specifiying IAM Role and access Policy?. I can connect to mysql databse using mysql…
ARUNBALAN NV
  • 1,634
  • 4
  • 17
  • 39
45
votes
5 answers

"invalid ELF header" when using the nodejs "ref" module on AWS Lambda

I've just uploaded a zip to AWS Lambda which included the "ref" (https://www.npmjs.com/package/ref), which is needed to validate an iOS Game Center authentication token (How to authenticate Game Center User from 3rd party node.js…
seaders
  • 3,878
  • 3
  • 40
  • 64
44
votes
27 answers

How to resolve: 'Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment'

I am trying to run CDK commands to check the diff of my local and remote stack. I am using the following command. cdk diff --profile saml I am getting the following error message Unable to resolve AWS account to use. It must be either configured…