Problem
By default lambda function code uploads are versioned automatically and have the next subsequent version number assigned automatically. This version number is also used in the connected CW log stream names.
In automated build and deployment systems this is irritating as it introduces an additional and independent level of versioning to the deployment chain.
Proposal
serverless function deploy should support a --version parameter that can be set by the deployment server to the version known to it. The AWS lambda REST API that is used to upload the function version during deployment supports specifying an explicit version number that will be attached to the uploaded function and that is then visible in the AWS lambda console (see https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionCode.html).
As the Version parameter pattern on AWS only supports [0-9]+ formatted versions (max. length 1024 chars) and deployment versions normally follow the Major.Minor.Revision.Build pattern, an implicit conversion should be done. IMHO the best way would be to use a fixed length, zero-prefixed, representation, e.g. 1.0.4.255 => 0001000000040255. The exact length of each of the version number parts should be discussed (although 4 characters per part seem to be feasible).
This also allows automated interpretation of the generated version numbers and direct association to internally used deployment versions for plugins or further core functionality.
Problem
By default lambda function code uploads are versioned automatically and have the next subsequent version number assigned automatically. This version number is also used in the connected CW log stream names.
In automated build and deployment systems this is irritating as it introduces an additional and independent level of versioning to the deployment chain.
Proposal
serverless function deployshould support a--versionparameter that can be set by the deployment server to the version known to it. The AWS lambda REST API that is used to upload the function version during deployment supports specifying an explicit version number that will be attached to the uploaded function and that is then visible in the AWS lambda console (see https://docs.aws.amazon.com/lambda/latest/dg/API_UpdateFunctionCode.html).As the Version parameter pattern on AWS only supports
[0-9]+formatted versions (max. length 1024 chars) and deployment versions normally follow theMajor.Minor.Revision.Buildpattern, an implicit conversion should be done. IMHO the best way would be to use a fixed length, zero-prefixed, representation, e.g.1.0.4.255 => 0001000000040255. The exact length of each of the version number parts should be discussed (although 4 characters per part seem to be feasible).This also allows automated interpretation of the generated version numbers and direct association to internally used deployment versions for plugins or further core functionality.