question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CDK: switch to CloudFront EdgeFunction

See original GitHub issue

Is your feature request related to a problem? Please describe. At the moment, CDK stacks have to be deployed to us-east-1 because of the Lambda@Edge function.

Describe the solution you’d like The CloudFront module provides a (experimental) EdgeFunction module that behaves exactly like a normal Function, however if the stack is deployed to a region that isn’t us-east-1, it will isolate the function into a new stack and create the function in the correct region.

Current blockers I’ve tried to switch to EdgeFunction locally, and there are a few issues:

  • version aliases clash (issue) fixed
  • role circular dependency (issue)

Re the circular dependency, the only solution seems to be using another stack and importing the role in. We could have ‘support’ constructs that go into a separate shared stack, which would also solve #947.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:11
  • Comments:5

github_iconTop GitHub Comments

4reactions
kirknesscommented, Mar 17, 2021

Hey Arjun, this sounds great. I’m hesitant to jump in a use an experimental module, although either way, I’ll have a play with this myself.

2reactions
oyedcommented, Jun 2, 2022

Any updates on this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

class EdgeFunction (construct) · AWS CDK
A Lambda@Edge function added to default behavior of a Distribution // and triggered on every request const myFunc = new cloudfront.experimental.
Read more >
Lambda@Edge example for the CloudFront construct ... - GitHub
There's the new experimental.EdgeFunction in @aws-cdk/aws-cloudfront that provides a convenience setup for creating these Lambda@Edge functions ...
Read more >
Using Lambda@Edge with CloudFront to configure redirect ...
An AWS CDK project to create CloudFront distributions with Lambda@Edge functions to replace Apache and mod_rewrite rules.
Read more >
aws-cdk.aws-cloudfront - PyPI
The CDK Construct Library for AWS::CloudFront. ... The following shows a Lambda@Edge function added to the default behavior and triggered on every request:...
Read more >
AWS Lambda@Edge created using AWS CDK doesn't put Log ...
I created a simple Lambda@Edge function like below. ``` 'use strict'; exports.handler = async function(event, context, callback) { const cf = event.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found