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
44
votes
9 answers

aws lambda Unable to import module 'lambda_function': No module named 'requests'

I have recently started to use AWS Lambda to use triggers against some python code I have written. I currently have 2 lambda functions, both of which have been created with ZIP files. The second one I created is supposed to test the trigger…
44
votes
8 answers

AWS python lambda function:No module named requests

I am fairly new to AWS and I am having some issues. Here is my code: from __future__ import print_function from urllib2 import Request, urlopen, URLError import requests import boto3 import json def lambda_handler(event, context): url =…
Zafar
  • 1,111
  • 2
  • 11
  • 23
44
votes
4 answers

Set expiration of CloudWatch Log Group for Lambda Function

By default when I create a Lambda function, the CloudWatch Log Group is set to Never Expire. Is it possible to set the expiration (saying 14 days) so I don't have to set it manually from the console after creation? Updated#1 Thanks to @jens…
niqui
  • 1,562
  • 1
  • 16
  • 28
44
votes
10 answers

Access Denied while sending email from AWS SES in Lambda function

I am trying to send an email using Amazon SES in AWS Lambda function, For this i am facing the following error. AccessDenied: User arn:aws:sts::XXXXX:assumed-role/lambda_basic_execution/awslambda_XXXX' is not authorized to performses:SendEmail' on…
RakeshKalwa
  • 671
  • 2
  • 6
  • 16
44
votes
4 answers

Sending email via AWS SES within AWS Lambda function

I have created a very basic simple function on AWS Lambda which will be used to accept form submissions. Part of the function will be to send an email to a particular person, pretty simple. I am trying to use AWS SES in order to do this. I have…
Darren
  • 795
  • 1
  • 6
  • 10
43
votes
3 answers

AWS Lambda API gateway with Cognito - how to use IdentityId to access and update UserPool attributes?

OK I am now days into this and have made significant progress but am still completely stumped about the fundamentals. My application uses Cognito User Pools for creating and managing users - these are identified on S3 it seems by their IdentityId.…
Duke Dougal
  • 24,359
  • 31
  • 91
  • 123
43
votes
4 answers

AccessDeniedException: Unable to determine service/operation name to be authorized

Using AWS CLI aws --version aws-cli/1.11.21 Python/2.7.12 Darwin/15.3.0 botocore/1.4.78 Creating a POST method for API Gateway as explained at https://github.com/arun-gupta/serverless/tree/master/aws/microservice#post-method. This method can be…
Arun Gupta
  • 3,965
  • 5
  • 31
  • 39
43
votes
6 answers

AWS API Gateway No 'Access-Control-Allow-Origin' header is present

I'm stuck on an issue with API gateway and I've gone through all the other SO answers on this, AWS forums and have been through their docs but still no joy. I am trying to setup an API using AWS API gateway which calls a Lambda function which…
user12345
  • 675
  • 1
  • 8
  • 17
43
votes
5 answers

Alexa Skills Kit trigger not available on drop down in AWS Lambda

I'm trying to build a simple AWS Lambda function that is triggered by the Alexa Skills Kit. I am following an Amazon made tutorial on creating the skill, etc. Unfortunately, Alexa Skills Kit is not an option on the drop down menu for the "Configure…
NewUser1213
  • 1,271
  • 2
  • 10
  • 12
43
votes
15 answers

Pandas & AWS Lambda

Does anyone have a fully compiled version of pandas that is compatible with AWS Lambda? After searching around for a few hours, I cannot seem to find what I'm looking for and the documentation on this subject is non-existent. I need access to the…
Moe
  • 766
  • 1
  • 5
  • 16
42
votes
6 answers

AWS Cognito: Add custom claim/attribute to JWT access token

My app creates a custom attribute "userType" for each new signed-up user. Now I would like this "userType" claim/attribute to be added to the JWT access token whenever the user signs in or the token gets refreshed. Is there an option to tell cognito…
Hiren Makwana
  • 1,976
  • 2
  • 13
  • 28
42
votes
6 answers

How can I set the AWS API Gateway timeout higher than 30 seconds?

I read here that I can set my Lambda function timeout for 15 minutes (https://aws.amazon.com/about-aws/whats-new/2018/10/aws-lambda-supports-functions-that-can-run-up-to-15-minutes/) However, when I try to set API Gateway inside the Integration…
Kamilski81
  • 14,409
  • 33
  • 108
  • 161
42
votes
4 answers

How do you look at console.log output of the amazon lambda function

When you do a console.log('Loading function'); in an amazon lambda function, where does that go? My setup api gateway lambda function nodejs6.10 curl https://n2tredacted.execute-api.us-east-1.amazonaws.com/prod/redactedFunc
42
votes
4 answers

conda environment to AWS Lambda

I would like to set up a Python function I've written on AWS Lambda, a function that depends on a bunch of Python libraries I have already collected in a conda environment. To set this up on Lambda, I'm supposed to zip this environment up, but the…
RoyalTS
  • 9,545
  • 12
  • 60
  • 101
41
votes
6 answers

Is it possible to modify AWS Cognito user attributes in the Lambda triggers

Having a look at the AWS documentation, https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html#cognito-user-pools-lambda-trigger-syntax-pre-signup you have the following paramaters…
Altus
  • 1,315
  • 3
  • 11
  • 19