getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.87k stars 1.55k forks source link

Provide AWS Lambda Layer ARN in package #9557

Open floriangosse opened 10 months ago

floriangosse commented 10 months ago

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",
    /* ... */
}
Lms24 commented 10 months ago

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.

floriangosse commented 10 months ago

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.

p0wl commented 9 months ago

this would be great!