Closed pkit closed 2 years ago
+bump, this adds at least 5-10 extra minutes on my CI build.
@pkit and @aaka3207 I honestly don't know what you mean by your comments. Please provide a more complete description of the problem if you'd like us to investigate it. Based on the limited information you provided, I doubt that the problem you're encountering is actually from this plugin. The plugin is very simple and just updates the CloudFormation template that Serverless Framework created, making the following changes to it:
That's it. So there's nothing we're doing there to cause the CF distribution to update each time. Likely you have some other code or plugin that's changing something on the CF distribution resource each time you build/deploy your service. For example, some plugins will put a tag on the stack and resources that contains the current git version number, or last-modified date. If the tags on the distribution change, maybe that's causing the re-deploy.
I'd suggest inspecting the CloudFormation templates that are in the .serverless directory after each deploy, and comparing them for subsequent deploys. That'll allow you to see what's actually changing.
@jthomerson Fair enough, apologies for not providing more details.
Essentially in my case it's always updating because SLS automatically versions, and versioning does a redeployment (of course redeploying functions @edge takes a while). I understand that this plugin needs versionFunctions
set to true, but I rarely even modify the code and by constantly re-versioning a function that doesn't change it wastes compute time on my CI/CD deploys.
Considering that CloudFront update is slow as hell And it's pointless to update it if function didn't change Maybe it shouldn't update?