Repository navigation
Add the versionFunctions provider flag that will reduce the default number of stack outputs - #3042
Conversation
There was a problem hiding this comment.
@ryansb thanks for the PR! 👍
As discusses earlier it would be great if this property can live in the serverless.yml file.
Something like:
provider:
versionFunctions: falseHere's a comment from @nicka about the config property...
When we do it the
serverless.ymlway (with the default option to true) we don’t have to worry about it being a breaking change. For me personally, I’ not being a big fan of it being enabled by default.
Suggestion: Within a newer version of serverless we could mention (in the cli logs) that the property will default to false within the next release.
Any additional thoughts @eahefnawy @nikgraf @mthenw
|
I agree with the provider setting and having it on by default for now to avoid a breaking change. I'm not sure if it should be on or deactivated by default long term. I personally thought on by default makes the most sense and that's why we initially merged it. It provides more insights when investigating error logs. @nicka why would you prefer it to be off by default? |
|
@nikgraf for me they don't add that much value, they bring issues by taking up the global Lambda functions storage (which you need to manually clean up), they take up CloudFormation resources and make deployments slower. |
2b061b9 to
12477eb
Compare
--versionFunctions CLI flag that will reduce the default nu…versionFunctions provider flag that will reduce the default nu…
… default number of stack outputs. Per serverless#2853, having versions as resources/outputs can trigger some limits related to CloudFormation stack outputs. This leaves the existing default, but if turned to `false` will reduce the number of outputs by N, where N is the number of functions total.
12477eb to
d4a1aaf
Compare
|
@ryansb Perfect!!! |
versionFunctions provider flag that will reduce the default nu…versionFunctions provider flag that will reduce the default number of stack outputs
|
Any way to disable this per stage? |
|
Yes, you'd set the value to an option like: |
|
Fantastic- thank you! |
|
How to achieve this using cloudformation? |
What did you implement:
Per #2853, having versions as resources/outputs can trigger some limits
related to CloudFormation stack outputs. This will (by default) reduce
the number of outputs by N, where N is the number of functions total.
How did you implement it:
Added an option
--versionFunctionsso that version resources aren't autocreated. This will also save code storage space as a side effect.How can we verify it:
serverless deploy --noDeployon any projectproject-stack-update.jsonand note theAWS::Lambda::Versionresources createdversionFunctions: falseto the AWS provider inserverless.ymlserverless deploy --noDeployon the same project::Versionobjects.Todos:
Is this ready for review?: YES
Is it a breaking change?: NO