31,972 questions
Advice
1
vote
2
replies
45
views
How does AWS Lambda suspend and resume container execution?
In the AWS Lambda runtime API, the process (acting as the "lambda runtime client") within the container is supposed to poll a HTTP endpoint for invocation details (then post the function ...
0
votes
0
answers
41
views
Ways to find unused code in aws serverless framework repos
We are migrating a service from the serverless framework hosted on AWS to a regular NodeJs, fastify server.
In the process of this, while we are slowly chipping away at the old code, we found that ...
1
vote
1
answer
175
views
How to run Playwright from AWS Lambda
I am trying to run Playwright test as part of SSM Automation by invoking Lambda function. I tried few approaches to create Docker image.
Use AWS nodejs-lambda base image.
FROM public.ecr.aws/lambda/...
1
vote
1
answer
56
views
How to return binary from AWS Lambda with Function URL
I want to return binary files (e.g. images, PDF) from an AWS Lambda function with a function URL. I am not using API Gateway.
The documentation for the return object does not say much about the body, ...
0
votes
0
answers
31
views
Access denied signed cookies CloudFront SPA App
I am trying to access a Vue SPA served with S3+CloudFront, restricted by signed cookies. This is for a platform that displays a user's active "apps". Each app is its own CloudFront domain.
...
Advice
0
votes
2
replies
93
views
Can anyone explain the overall architecture of AWS Lambda backend to me?
I have experience in frameworks like Django, Flask and FastAPI. Now I have a project requirement to do this in Lambda architecture.
Do I need to just vibe code it or learn and understand first, then ...
0
votes
2
answers
79
views
Having trouble deploying AWS SAM, even though the build succeeds
Goal: I have been tasked with deploying an AWS SAM build change in our dev environment, where the removal of two (of seven) image Lambdas is required. Let's call them FuncA and FuncB. These two ...
0
votes
1
answer
119
views
cloudfront-viewer-country-name stopped working in AWS
My setup is this:
outside -> CloudFront -> API Gateway -> Lambda
CloudFront distribution uses both Viewer request and Origin request lambdas.
In November, sometime between the 18th and 21st,...
0
votes
0
answers
60
views
Custom header set from API Gateway authorizer context not visible in Quarkus (HttpHeaders / @HeaderParam)
I am trying to pass a value from an AWS API Gateway Lambda Authorizer to a Quarkus REST endpoint via an HTTP header.
Below is a minimal reproducible setup.
Minimal Setup
1. Lambda Authorizer (context ...
0
votes
0
answers
57
views
Can I have a step function with concurrency higher than lambda concurrency?
I have two AWS step functions. The first iterates through a distributed map of a couple of thousand elements triggering the second. The second has three steps, let's call them A, B and C - each of ...
0
votes
2
answers
110
views
Why does my AWS Aurora DB & Proxy setup keep running out of database connections even though I'm following Lambda best practices?
I have built an application in AWS that uses AWS Lambdas for horizontal scaling (sometimes a handful run, other times hundreds for a few seconds). My lambdas are intermittently timing out due to no ...
3
votes
0
answers
102
views
Reading S3 parquet file with zstd compression in Lambda
I have parquet files with zstd compression in S3 that I am trying to read in Lambda. I use the below code but it gives error Support for codec 'zstd' not built.
df = wr.s3.read_parquet(path=s3_path)
...
1
vote
0
answers
69
views
AWS Lambda Server-Sent Events on .NET with AWS API Gateway
AWS has recently announced support for response streaming in AWS API Gateway. I am using AWS Lambda on .NET with ASP.NET using following pattern:
public class LambdaEntryPoint : ...
5
votes
2
answers
239
views
How to prevent race condition in AWS DynamoDB and Lambda
I have a pipeline where:
Lambda A reads DynamoDB and publishes events to Kinesis
Kinesis partitions events by key
Lambda B consumes the stream and writes the latest record per key back to DynamoDB
...
Best practices
0
votes
1
replies
38
views
Design the retry processing for AWS Lambda Function which consumes EventBridge events
I have a Typescript lambda function which consumes EventBridge event containing some payload. I want lambda function to be able to reprocess that event when the lambda code throws error. The event ...
0
votes
0
answers
68
views
AWS Lambda Getting Cloudflare Challenge Page from Stack Exchange OAuth
I'm implementing Stack Exchange OAuth 2.0 PKCE flow in an AWS Lambda function. The token exchange works fine when I test it with Postman using the exact same parameters, but fails when called from ...
0
votes
1
answer
110
views
Use Lambda layer in lambda on .NET 8.0
I have created a shared library and details are here:
sharedlibrary.csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</...
0
votes
1
answer
60
views
Lex InternalFailure Error with connect integration
I have a whatsapp bot implemented with connect + lex + lambda.
This error happening for the first time only. after that it works normaly and next day first time same error.
I am sending the correct ...
1
vote
0
answers
117
views
AWS Lambda TargetInvocationException : could not load file or assembly 'System.Data.SqlClient, Version=4.6.1.6'
I have a .NET 8 based multi-project backend solution. It uses GitHub actions to build the build/publish project with release, that is later used by AWS Lambda to run it whenever an invocation occurs.
...
1
vote
1
answer
96
views
Filter aws lambda event source on metadata
I'm trying to filter based on metadata values of incoming SQS events, not what is in their body.
From the documentation, it is mentioned that there is a messageAttributes attribute. I want to filter ...
0
votes
1
answer
110
views
Not all AWS resources (Lambdas) detected by Grafana
I am creating widgets in Grafana for monitoring AWS resources, including Lambda functions. For this purpose, I am creating variables that filter to just my team's Lambda functions using regex. Some ...
Best practices
1
vote
1
replies
180
views
How do I determine the correct order of Lambda layers in AWS?
I’m working with AWS Lambda and need to attach multiple Lambda layers to a function. I know that AWS allows you to specify the order of layers, but I’m unclear on how the ordering actually affects ...
Best practices
0
votes
0
replies
112
views
Do I need to redeploy an API Gateway stage after switching the Lambda integration?
I’m working with AWS API Gateway (REST API) and testing routes using the “Test” feature in the API Gateway console.
I changed the backend Lambda function that an API route is integrated with (for ...
Best practices
0
votes
1
replies
40
views
Is routing a production API Gateway to QA Lambda functions bad practice? What are the security and reliability risks?
I’m working on an AWS setup with multiple environments: master (production) and qa.
Recently, our Flutter app was getting 500 errors when calling the master API Gateway endpoints that are integrated ...
0
votes
0
answers
77
views
React to specific IAM Events in AWS
What I am trying to achieve is to trigger specific actions within my AWS Account when specific IAM actions are performed. This appeared to be much more complicated than I expected, so I wanted to ...
0
votes
0
answers
84
views
Parsed CSV rows are coming through as Buffers instead of arrays when loading files from S3
I'm pulling multiple CSV files from S3. Each CSV contains several rows in this format:
45,ABC,800046,HJN,9000
The first column is the employee ID.
I want to loop through all the files, parse each CSV, ...
2
votes
1
answer
190
views
Why my Alexa did not send ReportState directive after Discovery directive?
I want to enable alexa voice control for my smart home device. I was able to discover device. Now all devices are showing in alexa app. But all are showing as device is unresponsive.
This is my ...
-1
votes
1
answer
167
views
Class not found in AWS Lambda handler
I want to deploy AWS lambda with Spring Boot. I created a basic project with handler:
import com.amazonaws.serverless.exceptions.ContainerInitializationException;
import com.amazonaws.serverless.proxy....
1
vote
1
answer
73
views
Issue consuming API that returns Base64 Excel file in Angular
I am facing difficulties consuming an API in Angular that returns an Excel file encoded in Base64. The API is configured in AWS API Gateway and uses a Lambda function to generate the file. Although ...
0
votes
0
answers
44
views
AWS Error in Cloudfront + Appsync with 2 Authorizers OICD and new additional API_KEY, Cloudfront forcing x-api-key
I have an application that is in production working with Cloudfront + Appsync with OICD Authorizer. In the Cloudfront configuration for some reason it is adding in the custom headers if API_KEY exists ...
Advice
0
votes
6
replies
64
views
Display line of code in AWS CloudWatch for Amplify NodeJS written in typescript
I have the following resource in Amplify v2:
export const myFunction = defineFunction({
name: 'my-function',
layers: {
sharp: "sharp_arm64:1",
},
environment: {
BUCKET_NAME: ...
0
votes
0
answers
78
views
I have a working AWS Appsync application that uses OPENID_CONNECT as authorization, when I added API_KEY as additional broke the old routes
I have a working AWS Appsync application that uses OPENID_CONNECT as authorization, when I added API_KEY as additional broke the old routes. For some reason in the appsync schema it had in all routes ...
-1
votes
1
answer
213
views
Intermittent 500 Internal Server Error in AWS Lambda API (Different endpoints fail randomly)
I’m facing an issue with my React frontend and AWS Lambda backend setup.
When my app makes multiple API calls at the same time, some of them randomly return a 500 Internal Server Error, while others ...
-4
votes
1
answer
80
views
AWS Lambda Python script calling SageMaker: AlgorithmError: Framework Error
I am using lambda and Python and S3.
# lambda_bootstrap_train.py
import boto3
import time
import json
import os
sm = boto3.client('sagemaker', region_name='us-east-2')
s3 = boto3.client('s3', ...
-1
votes
1
answer
67
views
Why are all versions of Lambda@Edge function being modified when I deploy the latest code?
I have a Lambda@Edge function which has 2 versions. Version 1 has non-functional code and version 2 has the latest operational code. What that function does is it fetches an object from an S3 bucket ...
0
votes
0
answers
56
views
Client of Amplify Gen 2 is not being properly generated for subscription
Logging const client = generateClient<Schema>(); results in the following, which shows that the client is improperly generated:
{
"models": {},
"enums": {},
"...
0
votes
1
answer
108
views
Awswrangler: Parquet read into multiple of expected space
In a Lambda, I'm using AWS Wrangler to read data out of a date partitioned set of parquets and concatenate them together. I am doing this by calling wr.s3.read_parquet in a loop, compiling the loaded ...
1
vote
0
answers
72
views
How to identify which IdP a user used to sign in during AWS Cognito PreAuthentication trigger?
How can I determine which Identity Provider (IdP) a user used to sign in during the AWS Cognito PreAuthentication trigger, when multiple federated IdPs (SAML/OIDC) are linked to the same user?
In the ...
0
votes
1
answer
106
views
AWS Lambda inside VPC cannot connect to RDS MySQL (timeout)
Background
I'm building a Lambda function (Node.js 20 runtime) that connects to an Amazon RDS MySQL database within the same VPC.
Both the Lambda and the RDS instance are deployed in private subnets.
...
1
vote
0
answers
107
views
Is there an API to check for currently supported runtimes by AWS Lambda?
I’m developing a tool to speed up the AWS Lambda creation process for my colleagues and I, as we use it extensively, and I need to periodically check for deprecated runtimes. The idea is to create a ...
1
vote
1
answer
136
views
Lock a DynamoDB table on reading/writing operations
I have a DynamoDB table with entries that can have a status (waiting, error, running...). Only up to 25 entries can have running status.
My objective is to have an AWS Lambda function that checks if ...
0
votes
2
answers
76
views
AWS CloudWatch -> Firehose/Lambda -> Splunk flow -- lambda response too large
Given a CloudWatch -> Firehose -> Splunk flow, where Firehose passes incoming log records to a lambda, often the return from the lambda is larger than the allowed 6MB.
I've captured the payload ...
0
votes
1
answer
106
views
Spring Boot OAuth2 with Casdoor behind AWS Lambda + HTTP API v2: state parameter encoding issue
I’m developing a Spring Boot application deployed behind an AWS API Gateway (HTTP API v2) with Lambda (handler based on SpringBootLambdaContainerHandler and HttpApiV2ProxyRequest).
I’m using OAuth2 ...
0
votes
0
answers
57
views
AWS Lex + Lambda + API Gateway integration — request stuck on “Thinking…” and Lambda not triggered
I’ve built a simple web-based chatbot (called Engineer’s Toolkit) that uses Amazon Lex, AWS Lambda, and API Gateway, with a static frontend hosted on S3.
The flow is supposed to be:
Frontend (S3) → ...
0
votes
0
answers
61
views
Can't get AWS Lambda Powertools dynamic routes to work
from aws_lambda_powertools.utilities.typing import LambdaContext
from aws_lambda_powertools.event_handler import APIGatewayHttpResolver
from aws_lambda_powertools.logging import Logger
from validate ...
0
votes
1
answer
55
views
AWS Lambda not triggering on S3 ObjectCreated:Put after code edit. What am I missing?
I have an S3 bucket that should invoke a Lambda function on ObjectCreated:Put. This used to work. After editing the Lambda code in the console, new uploads stopped triggering the function. I do not ...
0
votes
1
answer
100
views
AWS Lambda: Runtime.ImportModuleError: /var/task/psycopg2/_psycopg.so: file too short after copying psycopg2 folder
I'm trying to use psycopg2 in an AWS Lambda function (Python 3.11 runtime).
I followed the jkehler/awslambda-psycopg2
repository and copied the psycopg2-3.11 folders directly into my Lambda deployment ...
0
votes
0
answers
58
views
In Remotion, Image Crop option is not working
I'm trying to generate a video using remotion library.
I have used the following two images
I have cropped the top option of image and places it on after another vertically. Please check the following ...
0
votes
1
answer
83
views
How to automatically extract AWS Lambda configurations to Terraform for GCP migration? [closed]
I'm migrating multiple AWS Lambda functions to GCP and need to generate Terraform configurations that match the existing AWS setup. Currently, I'm manually writing each Lambda configuration, which is ...
0
votes
0
answers
71
views
AWS Lambda + SSM RunCommand returns stale GetLastInputInfo() timestamp on Windows EC2
I’m working on an AWS setup where I need to detect last user activity (keyboard/mouse input) on a Windows EC2 instance.
Inside the instance, if I run this PowerShell snippet directly, it works ...