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
5
votes
1 answer

Debugging the CloudFront's problem after enabling Lambda@Edge

Following this article, I'm trying to serve my static content from multiple regions (under the same domain) within AWS. So far, I have: uploaded my content into an S3 bucket enabled the "static web hosting" for that bucket and made it…
Mehran
  • 15,593
  • 27
  • 122
  • 221
5
votes
0 answers

AWS Lambda@edge to set cookies to origin response

My objective is to protect an aws s3 bucket link and I'm trying to solve this by using cloudfront as the link via which the s3 buckets are accessible, hence when a user tries to access the cloudfront link, there is a basic auth if there's no cookie…
4
votes
1 answer

How to cache a Server Side Rendered Page using Dynamic Routes with Next.js

I'm deploying a Next.js Application on AWS using ECS/Fargate (can't use Amplify due to custom logging and monitoring required). My Application is using api-routes and dynamic-routes with Server-Side-Rendering(getServerSideProps). Lets say for the…
EternalObserver
  • 517
  • 7
  • 19
4
votes
0 answers

CloudFront Lambda@Edge not seeing custom headers in viewer request

I have a CloudFront distribution with a Lambda@Edge function which handles viewer request event. I want to send some custom headers and have them processed by Lambda@Edge, however Lambda function doesn't see them. For example I tried to send…
Yaiba
  • 571
  • 7
  • 14
4
votes
1 answer

Angular universal not rendering properly in Root path '/'

I'm having an Angular application with Angular Universal to support Server-Side Rendering (SSR). I have a problem on a root page. All other routes works perfectly on a SSR, but the "/" does not. As a try for a home route changed "/" to "/app" and it…
4
votes
1 answer

ERROR Validation error: Lambda function result failed validation, the function tried to delete read-only header, headerName : Content-Length

whenever I am trying to add response headers, the CloudFront throws me the ERROR Validation error: Lambda function result failed validation, the function tried to delete read-only header, headerName : Content-Length. ERROR Validation error: Lambda…
af_khan
  • 1,030
  • 4
  • 25
  • 49
4
votes
1 answer

CDK: Possible to put the stack created for EdgeFunction resource in another (cross-region) stack?

Problem statement I have my main CDK stack in eu-west-1, but an EdgeFunction is created in us-east-1. I have noticed two weird things with EdgeFunction: Even if declared in a NestedStack they appear in cdk ls as edge-lambda-stack-nnnnnnnnn (unless…
Erik Živković
  • 4,867
  • 2
  • 35
  • 53
4
votes
2 answers

Basic HTTP Authentication for CloudFront with Lambda@Edge in NodeJS

I am working on protecting a static website with a username and password. I created a basic HTTP Authentication for CloudFront with Lambda@Edge in NodeJS. I am completely new to NodeJS. Initially, I had the user and the password hardcoded, and this…
4
votes
2 answers

How to stop domain redirects when using a CloudFront domain as the custom origin at Lambda@Edge?

I want to use different origins according to the relative paths of my website. My root domain is example.com and it should be served with example01.cloudfront.net and example.com/pathxx/ should be served with example02.cloudfront.net. These two…
4
votes
4 answers

How to update lambda@edge ARN in cloudfront distribution using CLI

I would like to update the cloudfront distribution with the latest lambda@edge function using CLI. I saw this documentation, but could not figure out how to update the lambda ARN only. Can some one help?
cloudbud
  • 2,948
  • 5
  • 28
  • 54
4
votes
2 answers

CloudFront -> S3 for static or API Gateway with multiple dynamic backends in ECS

I need to implement a reverse proxy/redirect service for site which will be hosted in AWS S3 (static JS assets) + CloudFront and multiple backends running as different tasks AWS ECS available at domain.com/api/session_number Redirect or reverse…
4
votes
0 answers

How to remove .html extension using AWS Lambda & Cloudfront

I've my website's source code stored in AWS S3 and I'm using AWS Cloudfront to deliver my content. I want to use AWS Lamda@Edge to remove .html extension from all the web links that's served through Cloudfront. My required output should be…
4
votes
1 answer

AWS Lambda@Edge append querystring to response

Short Overview. I host an Angular Application on an S3 Bucket. I also got an Cloudfront distribution to handle HTTPS and Redirects. I try to form an querystring parameter depending on which URL the user is connecting to. 2 examples test.example.com…
4
votes
1 answer

SNS to SQS vs Direct SQS Put in Lambda@Edge Applications

I'm looking into using Lambda@Edge to place events generated from external sources into an internal SQS queue. The lambda simply needs to transform it when necessary, do the hand off, and leave. I'd like this to be as fast as possible, so my…
micah
  • 7,596
  • 10
  • 49
  • 90
3
votes
1 answer

Does CloudFront / Lambda / AWS support http 103 early hints?

Http status code 103, early hints, allows servers or edge nodes to send link headers early, so that clients can load resources in parallel to server processing. In practice, clients will first receive a 103 response with resources to preload,…
1 2
3
17 18