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
88
votes
3 answers

AWS Lambda : OpenBLAS WARNING - could not determine the L2 cache size on this system, assuming 256k - While using Google Custom Search API

I deployed the Google Custom Search API as AWS lambda function for my project. It uses the 3GB (full memory provided by lambda) and task got terminated. It throws a warning : "OpenBLAS WARNING - could not determine the L2 cache size on this system,…
87
votes
11 answers

AWS Java SDK - Unable to find a region via the region provider chain

I have gone through the question titled "Setting the AWS region programmatically 1" but it doesn't provide all the answers I need. Q1: I'm getting a SDKClientException-Unable to find a region via the region provider chain. What am I doing wrong? or…
Codistan
  • 1,469
  • 1
  • 13
  • 17
87
votes
6 answers

Specify log group for an AWS lambda?

Is there a way to specify the CloudWatch log group that an AWS lambda logs to? It seems to be generated directly from the lambda name; however, it would be especially convenient to, for example, aggregate multiple lambdas to a single log group. We…
86
votes
8 answers

Access AWS S3 from Lambda within VPC

Overall, I'm pretty confused by using AWS Lambda within a VPC. The problem is Lambda is timing out while trying to access an S3 bucket. The solution seems to be a VPC Endpoint. I've added the Lambda function to a VPC so it can access an RDS hosted…
musingsole
  • 1,057
  • 1
  • 8
  • 21
85
votes
3 answers

Why can't an AWS lambda function inside a public subnet in a VPC connect to the internet?

I've followed the tutorial here to create a VPC with public and private subnets. Then I set up an AWS lambda function inside the public subnet to test if it could connect to the outside internet. Here's my lambda function written in python3 import…
Brian
  • 12,145
  • 20
  • 90
  • 153
85
votes
14 answers

How to fetch/scan all items from `AWS dynamodb` using node.js

How to fetch/scan all items from AWS dynamodb using node.js. I am posting my code here. var docClient = new aws.DynamoDB.DocumentClient(); var params = { TableName:"users", KeyConditionExpression:"user_status=:status", …
Vishnu T S
  • 3,476
  • 2
  • 23
  • 39
83
votes
8 answers

Is it possible to use Socket.io with AWS Lambda?

Is it possible to build a function in AWS Lambda that creates a websocket and send data to subscribed applications? Something like this: John has the app SuperPhotoApp opened in his phone but decides to use the desktop browser to upload a photo to…
Vladislav
  • 1,392
  • 1
  • 12
  • 21
82
votes
7 answers

How can I retrieve a user's public IP address via Amazon API Gateway + Lambda (node)

I'm currently writing a Node.js lambda function, in which I want to log the incoming requester's public IP address. I've been looking through both the API Gateway and Lambda docs all day, but haven't found a solution. Does the lambda event object…
rdegges
  • 32,786
  • 20
  • 85
  • 109
81
votes
3 answers

AWS Lambda "errorMessage": Task timed out after 3.00 seconds

Lambda function showing the below error in test when changing file format from png to text "errorMessage": "2020-07-17T07:06:45.969Z b66dd037-ba01-4025-97db-6527b486eac8 Task timed out after 3.00 seconds"
eagletech
  • 821
  • 1
  • 5
  • 4
81
votes
14 answers

message: "Internal server error" when try to access aws gateway api

Created Lambda Hello world function using Node.js and created API GateWay trigger for Get call, tried the URL to access Lambda function, getting below error. message: "Internal server error". (very new to AWS)
user1671308
  • 859
  • 2
  • 8
  • 11
80
votes
16 answers

aws lambda function getting access denied when getObject from s3

I am getting an acccess denied error from S3 AWS service on my Lambda function. This is the code: // dependencies var async = require('async'); var AWS = require('aws-sdk'); var gm = require('gm').subClass({ imageMagick: true }); // Enable…
cyberdantes
  • 1,342
  • 3
  • 16
  • 28
79
votes
6 answers

SNS to Lambda vs SNS to SQS to Lambda

I'm trying to understand whether I need SQS in my workflow if someone can help explain. In my app, when an action is taken, it submits info to SNS topic which invokes Lambda to do some processing. This is working great as it is. When I do research…
Saumil Shah
  • 1,383
  • 2
  • 11
  • 20
76
votes
8 answers

Cognito User Pool: How to refresh Access Token using Refresh Token

I am using Cognito user pool to authenticate users in my system. A successful authentication gives an ID Token (JWT), Access Token (JWT) and a Refresh Token. The documentation here, clearly mentions that the refresh token can be used to refresh…
Hardik Shah
  • 916
  • 1
  • 7
  • 13
75
votes
3 answers

Why do I get 'execution role must be assumable' error when trying to deploy to Lambda@Edge?

I am trying to deploy to Lambda@Edge within AWS, but when I click on 'Deploy' I get this error message: Correct the errors below and try again. Your function's execution role must be assumable by the edgelambda.amazonaws.com service principal.
dagda1
  • 26,856
  • 59
  • 237
  • 450
74
votes
3 answers

AWS Lambda http, where do I find the URL?

I am fairly new to AWS Lambda but sure can see the benefits of it and stumbled upon the superb framework Serverless to help me built solutions on Lambda. I started out building solutions using AWS API Gateway but really need "internal" VPC API's and…
Anders
  • 3,198
  • 1
  • 20
  • 43