silvermine / serverless-plugin-cloudfront-lambda-edge

Adds Lambda@Edge support to Serverless
MIT License
296 stars 41 forks source link

Future of plugin #57

Closed thejuan closed 3 years ago

thejuan commented 4 years ago

We've been using the plugin for a while (thanks!) Looking to setup a new project but see Lambda@Edge is supported by serverless - https://www.serverless.com/blog/lambda-at-edge-support-added

Is this plugin now in sunset? Or does it add features above those found in core and active?

Thanks

jthomerson commented 4 years ago

@thejuan the plugin is still supported because I'm using it in a ton of places. But, in reviewing the Serverless docs, it does look like the framework is providing most of the same functionality natively now, so you may not need the plugin.

I'm not a huge fan of the Serverless Framework's default behavior of creating a CloudFront distribution for you (same with other event sources like SNS/SQS/S3/etc), but it does look like they allow you to override the CloudFront distribution by putting it the resources section of your YML with a pre-defined name. That works okay, but I prefer the plugin's approach because the plugin allows me to actually have multiple distributions in the same stack. I did that, for example, in this example site: https://lastweekingoogle.com/ (the code is at https://github.com/jthomerson/lastweekingoogle.com).

YMMV, but it looks like you could get by without the plugin now.

One other thing to check - I didn't see the Serverless docs mention it - is what happens to environment variables. The plugin automatically removes them for you. The framework may not.

Oh, and one other thing just came to mind when I was looking at that code. The framework says they force your Lambda function to have DeletionPolicy: Retain. The plugin does not do this. You can optionally set them to retain in the plugin. The framework is wrong - this is not required. But, there is an issue where once you delete the stack, sometimes CloudFormation gives you inconsistent results with deleting the function; additionally, it can take several hours for the function to delete because of the replication (I've seen as long as 24+ hours, but that was an extreme edge case).

If you do end up using the framework, please comment back here. I'll be interested in your take on it since you're an experienced user of the plugin. And, if you open any issues on the framework's issue tracker about missing or flawed functionality there, can you link it here to this issue so we have one place to compile the thoughts on whether we should eventually sunset this plugin?

Thanks!

thejuan commented 4 years ago

Thanks! Will continue here if its active :)

velovix commented 3 years ago

I think it's very good idea to keep this plugin maintained. Serverless' official support for CloudFront triggers is appreciated but rather strangely designed. Perhaps in the future it will be improved. For now though, the lack of support for multiple distributions is a deal breaker for my use-case.

david-gettins commented 3 years ago

Yes please do keep this plugin maintained. I agree with your points, @jthomerson, about Framework's implementation of this.

jthomerson commented 3 years ago

@velovix @david-gettins @thejuan don't worry - yes we'll be keeping this plugin for as long as those issues with the framework still exist and we still use the framework