Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda@Edge in SAM #323

Closed
sanathkr opened this issue Mar 7, 2018 · 13 comments
Closed

Lambda@Edge in SAM #323

sanathkr opened this issue Mar 7, 2018 · 13 comments
Labels
area/new-resource Label for new resources being asked/proposed area/resource/function maintainer/need-response stage/needs-feedback Needs feedback from the community (are you also interested in/experiencing this?) stage/pm-review Waiting for review by our Product Manager, please don't work on this yet type/feature

Comments

@sanathkr
Copy link
Contributor

sanathkr commented Mar 7, 2018

There was a discussion on Twitter that made me wonder if we should support Lambda@Edge native in SAM.

We already have a SAM example showing how to enable Lambda@Edge - https://github.com/awslabs/serverless-application-model/blob/master/examples/2016-10-31/lambda_edge/template.yaml. But this still requires setting up a CloudFront distribution and IAM Roles manually.

Can we add a Edge: True property to AWS::Serverless::Function resource that makes the function Lambda@Edge enabled? Will this be useful?

Please comment or +1 (reactions) if you will be interested in this feature.

@sanathkr sanathkr added area/resource/function type/feature stage/needs-feedback Needs feedback from the community (are you also interested in/experiencing this?) labels Mar 7, 2018
@sanathkr sanathkr added stage/request-for-comments and removed stage/needs-feedback Needs feedback from the community (are you also interested in/experiencing this?) labels Mar 16, 2018
@brysontyrrell
Copy link
Contributor

I would like to voice that doing this would ease a lot of deployment headaches. My expectation is that this key value would abstract away the AWS::Lambda::Version objects and handle creating and associating a new version on every update of the Edge function's code.

@yvele
Copy link

yvele commented Oct 23, 2018

With a Edge: True the Lambda@Edge can systematically be deployed by SAM in us-east-1 (as strictly required by Lambda@Edge) notwithstanding in which other region the Cloudformation stack (then CloudFront) is deployed.

Is that possible within SAM? 🤔 That could be awesomely great!

Resolving issue #635

@martysweet
Copy link
Contributor

This feature should also consider the time it takes to perform a Lambda@Edge update, due to the CloudFront distribution update time which CloudFormation waits for.

It is fine for the update to take a while if updating a Lambda function, as long as code has actually changed, and such, would be nice to somehow compare versions to prevent unnecessary new Lambda versions and deployments (though may be out the scope of this feature).

@iDVB
Copy link

iDVB commented Feb 27, 2019

Would also love to see Lambda@Edge abstraction in SAM. We're currently in the process of porting over some of our Serverless Framework implementations to SAM and Edge functions are something we use heavily.

I'd like to point out a few things that would also be great if this support included.

  1. Stacks containing Edge functions fail when deleting the stack. This will always happen unless the edge functions have DeletionPolicy: Retain which can also cause orphan functions but will allow stacks to delete successfully. Support for `DeletionPolicy in this abstraction would be great.

  2. There is already a Serverless Framework plugin/abstraction for Lambda@Edge functions that we use that is great. It might be helpful to read up on how that was implemented to see all the lessons learned.

@keetonian
Copy link
Contributor

@iDVB Could you provide some more information on what you'd like SAM to provide as part of support for Lambda@Edge?

@iDVB
Copy link

iDVB commented Mar 12, 2019

@keetonian Sorry, I meant it more as a mention if there aren’t already ways to do this with SAM. I’m brand new to it; previously using Serverless Framework exclusively. Once I take an honest dive in, I should have a better feel for what might be missing. Just could not google much in the way of Lambda@Edge and SAM. But I’m starting to think this is because SAM doesn’t really abstract functions and so they are handled the same regardless of edge or not.

@falnyr
Copy link
Contributor

falnyr commented Apr 14, 2020

@sanathkr is there any update on this?

@ugurcemozturk
Copy link

Hey, any update on this? It's getting used more and more

yvele added a commit to yvele/aws-cfn-custom-resource-lambda-edge that referenced this issue Jun 15, 2020
@awsjeffg awsjeffg added the stage/pm-review Waiting for review by our Product Manager, please don't work on this yet label Sep 4, 2020
@mgrandis mgrandis added stage/needs-feedback Needs feedback from the community (are you also interested in/experiencing this?) and removed stage/request-for-comments labels Feb 11, 2021
@aprilmintacpineda
Copy link

Any updates?

@jfuss jfuss added the area/new-resource Label for new resources being asked/proposed label Mar 30, 2022
@hungnv-sr
Copy link

4 years and a half later, any update?

@wynged
Copy link

wynged commented May 2, 2023

The stack deletion barrier has become a problem for us as well, we can't use the Lambda@Edge in our development stacks because they won't clean themselves up which would leave orphaned functions behind.

@Eeasan
Copy link

Eeasan commented Jun 15, 2023

any update?

@johanna-herrmann
Copy link

Any update?

@aws aws locked and limited conversation to collaborators Feb 7, 2024
@jfuss jfuss converted this issue into discussion #3525 Feb 7, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
area/new-resource Label for new resources being asked/proposed area/resource/function maintainer/need-response stage/needs-feedback Needs feedback from the community (are you also interested in/experiencing this?) stage/pm-review Waiting for review by our Product Manager, please don't work on this yet type/feature
Projects
None yet
Development

No branches or pull requests