Questions tagged [aws-lambda-edge]

AWS Lambda Edge or Lambda@Edge, lets user run AWS Lambda Functions across AWS edge locations globally using AWS-Cloudfront, which helps in sending responses to end users at the lowest latency.

AWS Lambda@Edge is a part of Amazon Web Services (AWS), which allows user to run AWS Lambda Functions across AWS edge locations globally.

It helps users in sending responses to their end users at the lowest latency by using AWS-CloudFront.

Lambda functions can be triggered by CloudFront events, such as requests for content to or from origin servers and viewers. Read More

Resources:

Documentation: What is AWS lambda@Edge?

Examples: Lambda@Edge

268 questions
3
votes
2 answers

Reduce size of authorization python AWS Lambda@Edge

I'm trying to implement authorization in my cloudfront distribution. It has worked so far until I ran into size limitation. I'm now running into the cloudfront error message Max allowed: 1048576, which is roughly ~1MB. But after installing the…
3
votes
4 answers

Serverless AWS Lambda@Edge: How to debug

I have a python Lambda@Edge function deployed with serverless which is working OK using the test feature: FYI it's setup as viewer-request: functions: cfLambda: handler: handler.lambda_handler events: - cloudFront: …
3
votes
1 answer

Reduce python AWS Lambda size for deployment on CloudFront

We have a Lambda function in python using below libraries pyOpenSSL==18.0.0 protobuf==3.14.0 The python code is less than 100KB, but with the above dependencies included the size goes to more than 4MB. Requirement is to deploy this Lambda on a…
Vivek
  • 175
  • 1
  • 9
3
votes
2 answers

Can't delete Lambda@Edge even though previously associated CloudFront distribution was already destroyed

Even though CloudFront distribution which was assiciated with a number of Lambda functions deployed @edge was already destroyed a couple of days ago, I still can't delete my lambda: it keeps referencing me to the "documentation for Deleting…
3
votes
0 answers

Lambda Edge Origin Request Trigger 502

I'm getting started with Amazon AWS and integrating JAMStack in their system, following their official tutorial (which includes this video) of a example project. Everything went smoothly until the creation of a Lambda@Edge Function. I just created…
3
votes
1 answer

Getting the client request domain from Lambda@Edge function

I'm trying do something like below for HTTP 301 redirect, so that web users will redirect to different news pages. if ((request.uri == "/news") || (request.uri == "/news/") && (request.origin.domainName == "sub.mydomain.com")) { …
3
votes
3 answers

Lambda@Edge - You cannot update the specified distribution using this API version because it is associated with a cache policy

I am trying to setup Lambda@Edge but getting the following error on clicking Deploy to Lambda@Edge button. You cannot update the specified distribution using this API version because it is associated with a cache policy. My CloudFront distribution…
Suresh
  • 627
  • 6
  • 16
3
votes
2 answers

Lambda@Edge limitation to be deployed to us-east-1 prevents me from deploying S3 bucket to Europe

Update: The short version of the issue that I wanted to cross-reference some values in different stacks in different regions but the documentations were so confusing to let me think it's not possible to do that but it's possible, just I had to…
3
votes
1 answer

AWS CloudFront returns 503 for regions other than us-east-1

I am trying to configure a cloudfront distribution with a lambda@Edge function linked to the origin request event. The lambda edge returns a very basic html page (the code is based on this example: Serving Static Content (Generated Response)). Once…
3
votes
1 answer

Can I host my next.js on AWS lambda edge and have a separate API server?

Next.js is about server side rendering. Therefore have the render server (rendering the HTML) along with the API server seems to be a natural choice— it probably makes the rendering time much lower than having a separate API server (service) That’s…
chen
  • 4,302
  • 6
  • 41
  • 70
3
votes
2 answers

DynamoDB access in Lambda@Edge

Need your help in understanding some concepts. I have a web application that uses Lambda@Edge on the CloudFront. This lambda function accesses the DynamoDB - making around 10 independent queries. This generates occasional errors, though it works…
3
votes
2 answers

Google indexing Cloudfront distribution

I have a static site through Cloudfront with an S3 origin & custom domain via Route 53. All works well, except that Google has also indexed the Cloudfront distribution url (d123etc.cloudfront.net) as well as my custom domain, leading to duplicate…
peterorum
  • 1,401
  • 2
  • 15
  • 21
3
votes
3 answers

Moving existing lambda edge to Serverless Framework

I have a Lambda Edge attached to a CloudFront distribution. What I want to do is use Serverless Framework to publish the lambda (instead of manually uploading files and click on "Deploy to Lambda@Edge"). What I've tried to do, looking at the…
Jimi
  • 1,605
  • 1
  • 16
  • 33
3
votes
1 answer

lambda@edge timeout and s3 image processing

I use a lambda@edge function to resize images on the fly. this works quite well - except when calling this function f.e. 5x at the same time. then the lookup for the image on s3 takes ~4 seconds. since lambda@edge functions only have a max. timeout…
misantronic
  • 1,132
  • 2
  • 10
  • 23
3
votes
1 answer

Does cache vs no-cache effect CloudFront pricing?

I need to serve out large files (10-50GB) at low volumes from an S3 bucket. I am using CloudFront because I need Lambda@Edge to inspect the requests before they hit the s3 bucket. From the AWS docs here I understand that I pay for Data Transfer Out…
simj
  • 183
  • 2
  • 10