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

Lambda@Edge when triggered Dynamodb giving 503 Error

I am trying to invoke Lambda through cloudfront viewer request . Here is my Lambda code 'use strict'; const AWS = require("aws-sdk"); const docClient = new AWS.DynamoDB.DocumentClient(); exports.handler = (event, context, callback) => { /* Get…
Private
  • 1,661
  • 1
  • 20
  • 51
0
votes
1 answer

How to access browser X509 SAN attribute in AWS Lambda@Edge

I have scoured the AWS documentation but find no hint on how do this.. I'm new to Lambda@Edge and porting a legacy apache web server app to the platform. In apache web server and nginx we have access to X509 cert attributes via environment…
garyM
  • 802
  • 2
  • 12
  • 29
0
votes
1 answer

Lambda@Edge routing between two origins based on cookie

Can some please tell me how to route to 2 different origins based on cookies using Lambda@Edge? I tried below code, but it is not working. Thanks in advance. 'use strict'; exports.handler = (event, context, callback) => { const request =…
0
votes
1 answer

AWS CloudFront Lambda@Edge deployment

I am new to AWS world and trying to create Lambda@Edge from Github project. I went through the tutorial and could create lambda from AWS console. Now that I am aware of the basics I wanted to create a GitHub project for lambda handler and deploy it…
user8453102
0
votes
1 answer

Add specific header to HEAD response to AWS S3 file

I want to get to know the size of a file to decide if I'm going to make a GET request to download it or not. The file is in my AWS S3 Bucket. I know that it is a good idea to make a HEAD request to the same URL, so it returns me the…
0
votes
0 answers

AWS EC2 to cloudwatch event to lambda to SNS

I need a function that captures input from Cloudwatch into Lambda and sends out to SNS. Does anyone have any samples of that flow?
0
votes
1 answer

How to hit the cloudfront origin from lambda@edge?

I have done redirection using lambda@edge in Cloudfront. How to hit the origin back at certain conditions from lambda@edge ?? Is that possible ??
0
votes
1 answer

boto3 not able to access given region name while taking region provided by AWS Lambda

I have boto client like this client = boto3.client('rekognition', region_name="us-east-1") I am using this client to detect text from image and deployed code in AWS region where Rekognition api is not available but provided the region-name where it…
0
votes
1 answer

aws lambda@edge + Cloudfront ERROR ()

I'm using lambda@edge + cloudfront to do some image resizes etc. My origin is S3 bucket. ISSUE: When I try to call for an object inside s3 via cloudfront over browser I get the above error (picture). it even happens when I use just a test…
-1
votes
1 answer

Cloudfront with lambda edge not working with new cache behavior

I had a CloudFront distribution using the legacy cache Behavior and Aws Lambda Edge to change the origin path to serve multiple websites using the same bucket. This was my lambda edge that was working with the legacy cache behavior: …
Michel Borges
  • 921
  • 1
  • 9
  • 16
-1
votes
1 answer

CloudFront and S3 with "user-agent" condition

, i have setup CF distro with S3 as an origin but i want to make a condition before i serve the content The condition i want it to make sure the request have "user-agent": "example" inside , if she has ONLY then serve the content and if not block…
Yahav
  • 59
  • 6
-1
votes
1 answer

Terraform error updating CloudFront Distribution InvalidLambdaFunctionAssociation: The function cannot have environment variables

I am trying to build a terraform template that creates an AWS S3 Bucket, Cloudfront Distribution and a Lambda function that should be associated with the Cloudfront Distribution. As soon as I add "lambda_function_association" to the Cloudfront…
-1
votes
2 answers

lambda@edge functions without hardcoding variables

I am using the serverless framework and I am building all my resources all at once. I have lambda@edge function in AWS cloudfront viewer request side and the function needs access to cognito user pool id. Since I am not able to pass environment…
Aimn Blbol
  • 907
  • 11
  • 20
1 2 3
17
18