[lambda] Lambda@Edge support
See original GitHub issueIt would be great to have a L2 construct providing Lambda@Edge support. Though it’s not clear to me what the best way to add this would be, since whereas most other event sources have a method on the resource (i.e. such as topic.subscribeLambda(...)
), Lambda@Edge associations are made between a lambda function and a specific behavior of a distribution, and the individual behaviors are not exposed by the L2 construct (you end up with a CloudFrontDistribution object, but no way to reference individual behaviors of that distribution).
Adding support for Lambda@Edge would probably also require adding better support for Lambda function versions (it would be great to just be able to use something like AutoPublishAlias from SAM).
Issue Analytics
- State:
- Created 5 years ago
- Reactions:41
- Comments:27 (15 by maintainers)
Top Results From Across the Web
Lambda@Edge - Amazon AWS
Lambda @Edge is a feature of Amazon CloudFront that lets you run code closer to users of your application, which improves performance and...
Read more >Using Amazon Lambda with CloudFront Lambda@Edge
Lambda @Edge lets you run Node.js and Python Lambda functions to customize content that CloudFront delivers, executing the functions in Amazon locations closer ......
Read more >What is Lamdba@Edge? Pricing, Examples, Benefits
Lambda @Edge allows you to run code across Amazon CloudFront edge locations globally without provisioning or managing servers, responding to end-users at the ......
Read more >Increase application performance and reduce latency with ...
Lambda @Edge is one of the most widely used computing and content delivery services today, a provisional feature in Amazon CloudFront ...
Read more >AWS Lambda@Edge - Optimizely
Lambda @Edge is an extension of AWS Lambda, a compute service that lets you execute functions that customizes the content that CloudFront delivers....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So I was able to solve my task with this way. My requirements were mainly that I want to have bucket in a different region than us-east-1, so I need to pass the lambda version somehow to another region
First definitions:
Then the edge lambda stack itself:
Then cloud front definition:
Then stack creation
To test that it works:
/lambda/index.js
(edge lambda)/cfn/stack.js
don’t forget to add
/cfn/cfn-response.js
file with a content listed here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.htmlpublished an article https://lanwen.ru/posts/aws-cdk-edge-lambda/
Using SSM seems like a simpler solution indeed: when you define your lambda@édge
And to get it in a stack in another region: