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

Can we add a CloudFront behavior based on request header?

Behaviors on Cloud front are based on path. I'm trying to see if there is another way to add behavior based on request header without involving Lambda@Edge? For example, requests with header 'user-agent'='somecrawler' will be directed to behavior,…
2
votes
1 answer

serverless deploy lambda@edge with specific dependency

I want to deploy function for Converting images to WebP from CloudFront as mentioned here But I want to use serverless framework and I have created following serverless.yml & my handler.js service: viewer-image-request plugins: -…
2
votes
2 answers

Lambda@Edge through Go SDK

I am trying to associate a Lambda@Edge Function using the AWS Go SDK. Creating the Function by hand in the console and assigning it to the Cloudfront distro using the SDK => works. Creating the Function (using the same IAM role from 1.) in the…
2
votes
1 answer

Use sharp on lambda@edge

I'm trying to use sharp on a couple of AWS lambda@edge. The idea is to resize and cache an image when requested (see this). I'm also using serverless with serverless-webpack to deploy the lambdas. I can deploy the lambdas and everything goes well if…
paezinc
  • 339
  • 1
  • 3
  • 13
2
votes
1 answer

Get referrer within AWS Lambda@edge

Not seeing the referrer in the documented event structure, and I haven't seen anything in the object in my test lambda - but that's not necessarily an accurate representation of a live request. Is there a way to determine the referrer in the…
Randy Hall
  • 7,716
  • 16
  • 73
  • 151
2
votes
1 answer

Lambda@Edge and AWS EC2 latency comparison

Currently, I have built an application on EC2 instances in multiple regions. The problems are when one instance per region need to patch/maintain, and we need more effort to handle if something fails. I decide to use Lambda@Edge instead of EC2 and…
2
votes
1 answer

Adding Lambda@edge includebody field in cloudfront using cloudformation template?

I am trying to add Lambda@Edge association in cloudfront using cloudformation. As per aws docs they had only two fields like EventType and LambdaFunctionARN . But i want to add IncludeBody in cloudformation so that my Lambda@Edge will read the body…
Private
  • 1,661
  • 1
  • 20
  • 51
2
votes
2 answers

is there a way to load external data in Lambda@Edge

i was trying to use Lambda@Edge to handle A/B testing in my site. i wonder is there a way to let Lambada@Edge functions load an external config data from a url, eg. i created an api to return the traffic rates of A/B channels,i want control that…
Kent Wood
  • 1,392
  • 2
  • 14
  • 30
2
votes
1 answer

Pass through headers form Viewer request to origin request in AWS lambda@Edge

Is there any possibility to pass through headers form viewer request to origin request without white listing the Vary headers in AWS Lambda@Edge.
Saravanan
  • 115
  • 2
  • 15
2
votes
2 answers

Cloudfront referencing old Lambda@Edge version

I'm still very new to AWS so this may be wrong but it seems to my Cloudfront distribution is pointing to an old broken versions of my Lambda@Edge function. I followed this tutorial to get my initial setup:…
DasBeasto
  • 2,082
  • 5
  • 25
  • 65
2
votes
1 answer

Single Page Application with Lambda@Edge

So I have a SPA served from AWS S3 by AWS Cloudfront. I have configured the following Error Pages behaviour: 404: Not Found -> /index.html with HTTP code 200 This is needed to be able to handle routing on the client-side. Now I've got a Lambda@Edge…
appelblim
  • 65
  • 6
1
vote
1 answer

can lambda@edge events arrive in batches?

Creating an origin request lambda@edge to intercept cloudfront events. Every example I can see in the aws docs https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-examples.html refers to the event as const request =…
tmc
  • 404
  • 1
  • 7
  • 20
1
vote
1 answer

How to restrict user to directly access static files hosted on Cloudfront

I am hosting micro-frontends on S3 behind Cloudfront. I do not want people to access static files through direct URL. I was looking for solution and found we can protect through access token which can be validated by Lambda@Edge. I don't want…
1
vote
0 answers

How does Lambda@Edge decide which region to run in?

My CloudFront distribution is geo-restricted to UK only. My WAF is blocking all non-UK traffic. I have a Lambda@Edge function attached to my CloudFront, triggering from "origin request". Testing this from my home in the UK: my function mostly…
1
vote
0 answers

Cloudfront and S3 folder problems

I have created one bucket and one cloudfront distribution. I followed this resource https://opsdocks.com/posts/multiple-websites-one-s3/ because I am going to host 3 different domains with only one bucket. I have this folder structure in my…