Questions tagged with AWS Lambda

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

We deployed a new version of a serverless (python) application yesterday. All the CloudFormation events have it looking like a successful deployment. The error is that every lambda gets the ` Handler 'handler' missing on module 'routes/file_name'` We have not made any changes to the structure of our code, nor any changes at all from the AWS console. The changes we made are to use a newer version of Google Ads library, and also deployed from a new machine that required an updated version of `serverless` and `node` packages (plus whatever changed in their dependencies.) ``` $node --version v16.19.1 $serverless --version Running "serverless" from node_modules 1.30.1 ``` I tried - Rolling back one of the lambdas by specifying an older version int he API Gateway function that acts as a pass-through to the lambda. - Deploying a previous version of our code, which I believe is exactly what was already being used by the lambda - Creating an alias of an old version of the lambda, but couldn't figure out what to do with it. I also double-checked the CloudWatch logs and verified that things were working correctly before the new deplioyment. And finally, we deployed another app with a single lamda that gets its input from an SQS queue, with the same (broken) result. This is causing a production outage of functionality that is important to our customers.
1
answers
0
votes
15
views
asked 3 days ago
Hi All. I have had multiple emails recently from AWS with subject line “[ACTION REQUIRED] - Update your TLS connections to 1.2 to maintain AWS endpoint connectivity [AWS Account: 090759423501]”. The key part of the email seems to be ..................... Please see the following for further details on the TLS 1.0 or TLS 1.1 connections detected from your account between February 25, 2023 and March 13, 2023 (the UserAgent may be truncated due to a limit in the number of characters that can be displayed): Region | Endpoint | API Event Name | TLS Version | Connection Count | UserAgent eu-west-1 | dynamodb.eu-west-1.amazonaws.com | DescribeTable | TLSv1 | 324 | aws-sdk-dotnet-45/3.3.1.0 aws-sdk-dotnet-core/3.3.5.0 .NET_Runtime/4.0 .NET_Framework/4.0 OS/Microsoft_Windows_NT_10.0.14393.0 ClientSync Docu ............................ However, my reading of that is that it is a system call from a .net runtime and I’m not really sure what I can do about this. Your assistance would be appreciated. I typically use AWS resources in two ways: a) scheduled or triggered Lambda calls built directly in the AWS interface or b) calls from c# .net programs coded in Visual Studio I followed some links to literature that the AWS account manager gave me which suggested 1) Use the Cloud Trail section of CloudWatch to find log entries where TLS 1.0 or 1.1 was used - I tried this but could find no matching records when I ran the query 2) Check the general account health dashboard - I did this but no problems are reported there. Can anyone suggest a course of action here? Thanks Richard Abbott
1
answers
0
votes
16
views
RBA
asked 3 days ago
My lambda takes a long time to do the first operation with an aws client. For example I am performing a query on the index through the dynamoDB client and the first execution takes 2 seconds, while in subsequent executions on the same lambda environment the query is executed in 100 milliseconds. The DynamoDB client is inizialized outside of the Lambda handler method. Why my first execution takes so long?
1
answers
0
votes
20
views
asked 3 days ago
**Error ----------------------------------------------------------------------------------------------: ** <?xml version="1.0" encoding="UTF-8"?> <Error> <Code>SignatureDoesNotMatch</Code> <Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message> <StringToSign>PUT **Code in Python----------------------------------------------------------------------------------------------: ** import botocore import boto3 import datetime from botocore.exceptions import ClientError import json s3_file="test6.jpg" def lambda_handler(event, context): # TODO implement print("Step 1") try: s3 = boto3.client('s3') url = s3.generate_presigned_url( ClientMethod='get_object', Params={ 'Bucket': 's3_Bucket', 'Key': s3_file }, ExpiresIn=36000000 ) result = {'status': 'success', 'data': {'url': url, 'key':s3_file}} response = { 'statusCode': 200, 'body': json.dumps(result), 'headers': { 'Content-Type': 'application/json' } } except ClientError as e: print(f'Error generating presigned URL: {e}') return None return response
1
answers
0
votes
21
views
asked 3 days ago
Hi all, I'm building a chatbot using: `Twilio -> Lexv2 -> Lambda` I would like to capture the phone number of the user that is currently texting the bot in order to log information about the interaction along with a couple of other things. Right now the only request attribute that is coming across in the event is: ``` "x-amz-lex:channels:platform": "Twilio" ``` Is there anything I need to enable in order to get the phone number that started the interaction passed through in the request attributes?
1
answers
0
votes
30
views
asked 4 days ago
Hi there, I was reading the official documentation on https://github.com/aws/aws-xray-sdk-go but not quite sure how can I add the Cognito client that is created on my lambda function to the service map and x-ray traces. ``` import ( "context" cognito "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider" "github.com/aws/aws-xray-sdk-go/xray" ) func GetClient() { ... cfg, errCfg := config.LoadDefaultConfig(context.TODO()) client := cognito.NewFromConfig(cfg) // the next line is not valid, because the function receives a *client.Client as a parameter // and my current client si of type *cognito.Client // the error is: cannot use client (variable of type *cognitoidentityprovider.Client) as *"github.com/aws/aws-sdk-go/aws/client".Client value in argument to xray.AWS xray.AWS(client) ... } ``` I appreciate your advice.
0
answers
0
votes
26
views
Juan
asked 4 days ago
When I run the lambda (.net 6) code locally pointing to the SES host, it works. But, when I call the lambda function, it returns 503 error and don´t send the email. Considerations: - The lambda function is under a vpc´s public subnet - I'm using the .NET MailKit package to send the emails: public void Send(string to, string subject, string html, string from = null) { // create message var email = new MimeMessage(); email.From.Add(MailboxAddress.Parse(from ?? _appSettings.EmailFrom)); email.To.Add(MailboxAddress.Parse(to)); email.Subject = subject; email.Body = new TextPart(TextFormat.Html) { Text = html }; // send email using var smtp = new SmtpClient(); smtp.Connect(_appSettings.SmtpHost, _appSettings.SmtpPort, SecureSocketOptions.Auto); smtp.Authenticate(_appSettings.SmtpUser, _appSettings.SmtpPass); smtp.Send(email); smtp.Disconnect(true); } I´m using the sandbox setting and both (sender and receiver) are verified. I have also created an policy like bellow and attached it to the lambda role: } "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "ses:SendEmail", "ses:SendRawEmail" ], "Resource": "*" } ] } Could anyone help me with this issue please?
0
answers
0
votes
11
views
asked 4 days ago
Hello, I was trying to build FTPS server using Transfer family, But I couldn't able to successfully build one. Could some one explain in details how to build one in detail. I tried browsing online for guidance all I could find is for building SFTP server. I need help in building "custom identity provider" using rest API and lambda function. I couldn't find the code for the lambda function.
1
answers
0
votes
20
views
asked 4 days ago
I am seeking guidance on how to resolve the problem with Elasticache Memcached that we are currently encountering. Our setup consists of a 2-node cluster, and our application is based on Lambda. To ensure read availability, we write requests to both nodes. However, we are facing random connection timeouts that last for 10 to 30 seconds, and we receive "get_misses" errors. Upon checking the metrics, the CPU usage is low (around 5%) and there is sufficient available memory. Can someone offer suggestions on how to troubleshoot this issue?
1
answers
0
votes
28
views
Ashish
asked 4 days ago
I need to create a lambda function without putting any source, so that terraform script will just create a lambda. This will be in infra repo you can say that where I am just provisioning the services. Then in another repo which will be used by developers where we will have a application code which needs to be deployed in that lambda. So when I am creating the lambda using terraform in Infra repo, then source_path seems mandatory... please suggest how I can achieve this.
1
answers
0
votes
25
views
asked 4 days ago
Java 17 is not supported by aws lambda. I need to create a lambda function using spring cloud and java 17 as base image. What dependencies i must install in my java 17 base image?
1
answers
0
votes
26
views
asked 4 days ago
I am trying to get a notification each time an S3 object is opened (read), and wondering if this is possible using S3 notifications. We are using a barcode scanner to open pdfs stored as S3 objects. I found a tutorial somewhere on how to do this: "For the "Events" section, select the "All object read operations" or choose "Specific object read operations" and check "GetObject". This will trigger the event when an object is opened (read)." Here's where I'm looking for notifications: S3 bucket > Create event notification > ("Specific object read operations") - cannot find this trigger. So, is there a way to send a notification or trigger a Lambda function when an object is opened?
1
answers
0
votes
30
views
srfsup
asked 5 days ago