Provide AWS Lambda Layer ARN in package
Problem Statement
I want to utilize AWS Lambda Layers in my setup but it's hard to know what features are included in the layer's versions. This way it's hard to track official Sentry package releases together with the layer's versions.
Solution Brainstorm
If we could provide the AWS Lambda Layer version inside of the @sentry/serverless package we can use this to get matching version in out Lambda functions.
It could be a JSON file that just contains the ARN per region. Example:
{
"us-east-1": "arn:aws:lambda:us-east-1:943013980633:layer:SentryNodeServerlessSDK:184",
"us-east-2": "arn:aws:lambda:us-east-2:943013980633:layer:SentryNodeServerlessSDK:184",
/* ... */
}
Hi @floriangosse thanks for writing in!
Is there some kind of official recommendation for tracking this in the actual package? I feel like otherwise adding a JSON file is quite a cumbersome method of checking this. Furthermore, our publishing process makes it hard (next to impossible) to get the published ARN before publishing the package to NPM.
That being said, we're aware of this problem (in fact, I raised it internally a while ago and IIRC there's a GH issue somewhere about the problem but I couldn't find it). However, at the moment we cannot spend time on Serverless due to more pressing issues. Backlogging this but I can't promise any ETA.
Is there some kind of official recommendation for tracking this in the actual package?
I don't know any "official way" or way how others are doing it.
We could change the order in which the packages are published by building the AWS Lambda Layer as the first thing after a version bump an use the returned to ARN to add it to the packages that will be published to NPM. Haven't looked in detail into the whole release pipeline so I don't know how hard it is.
this would be great!
+1
I don't think it's feasible to get this into the npm package itself given our release flow. We do however expose this info in our public release registry: https://release-registry.services.sentry.io/aws-lambda-layers und the sdk_version field.
Would that help?
@andreiborza I think that might be a good starting point but I think it could cause problems as soon as the SDK version that's used in the lambda function and the one in the public release registry drift as the release registry seems to contain only the last referenced version of the SDK.
@floriangosse yes, you're right. You'd have to somehow cache it yourself for now, but we do have plans to extend the release registry api to be able to query for it.
@andreiborza if you plan to have the option to query for specific SDK version, it would solve the drifting problem. Do you plan to come up with a documentation for the registry and maybe some tooling for querying the registry?
Probably documenting it, but just a heads up, this is probably not going to be worked on for another 2-3 months. Until then, I suggest maintaining a cache somewhere on your side based on the release registry.
@andreiborza thanks for this update.