-
Notifications
You must be signed in to change notification settings - Fork 154
Feature request: SSM parameter(s) for latest layer compatible with semantic version range #3809
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
Comments
Hi @scratchclaggy, thank you for opening the issue. As shared on the Discord thread, the feature request deviates a bit from what we initially discussed - and I don't see us doing what is described above. AWS Lambda layers versioning is somewhat rigid. When publishing a new layer version you cannot specify an arbitrary version number. Instead, the version number of the layer is an integer number incremented every time you publish a new version. Likewise, when attaching a layer to a Lambda function, you can only do so by setting a specific version number - you can't for example use a range. We understand that this makes things somewhat complex when the contents of that layer follow a different - arguably more sane - versioning strategy, like semantic versioning. Because of this, we started publishing SSM parameters that allow you to lookup a Lambda layer ARN. We started by publishing two types:
After the discussion we had on Discord, and thanks to your proposal, we discussed adding a third one:
This will allow customers to use the SSM parameter without worrying about automatically upgrading to a major version that they might not have tested, and that might contain breaking changes. We discussed this within the team, and concluded that it's something we consider in scope and can work on in the coming weeks. I believe that this is as far as we want to go in this area, at least for the time being. We won't be implementing a true semantic versioning, nor the concept of ranges. As stated also in our tenets, our focus is primarily on enhancing the developer experience within AWS Lambda, and while Lambda layers are definitely adjacent to this - they're not something we have the capacity to focus on at this time. We provide the Lambda layers primarily for convenience, and while I completely understand that their versioning scheme is not optimized for keeping production and development aligned, solving this problem is not something that fits with our current mission. To sum up, we are going to add a new SSM parameter that follows the latest version of a major release (i.e. For all those other customers who want to have a tighter control over which version of Powertools for AWS goes in their Lambda function, bundling dependencies is probably the preferred option. |
Thank you for the feedback! Sorry for getting a bit carried away, I didn't intend to deviate from what we covered over in Discord, I was just trying to explain the general case without locking things down. In my head, offering a 2.x release parameter is an, admittedly loose, form of semantic version ranges. I agree that offering a parameter that is tied to the latest for a given major is going to cover 95% of people's requirements, myself included. Those who aren't satisfied always have the option to ship their own dependencies as discussed. Trying to fully cover semantic versioning in a way that mirrors package managers would be pretty unwieldy. I am happy to put in some work for this one, did you want me to have a crack or have you already got someone in mind for it? What are your thoughts on my alternative idea? As mentioned, it's only useful when you're using CDK or similar, but it feels like it could be a little more flexible than the SSM parameter. |
This would force to cross the boundary from runtime library to build library. I think CDK can be a good place to add this utility, similar to the layers they package already. But we'd need to propagate the version changes after each release and it be a bit challenging to reduce the replication delay of this information to CDK repo. Not impossible, but I don't really see the practical side. I like the idea of having |
Use case
Package managers within the Node ecosystem give users the ability to specify different semantic version ranges for the packages used within a project. However, when Powertools users leverage the published lambda layers, they are not able to enjoy the same semver guarantees as they rely on in their
package.json
.Solution/User Experience
While users can currently access the latest powertools layer that is available via an SSM parameter, it would be useful for a similar parameter to exist which points at the latest layer compatible with an arbitrary semver range.
e.g.
package.json
->^2.17.0
/aws/service/powertools/typescript/generic/all/2
->arn:aws:lambda:{region}:094274105915:layer:AWSLambdaPowertoolsTypeScriptV2:23
Alternative solutions
Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: