AWS Lambda Layer (Node)

Learn how to set up Sentry with a Layer

You can also install Sentry using a Lambda Layer instead of adding @sentry/aws-serverless with npm or yarn. Import Sentry as usual:

const Sentry = require('@sentry/aws-serverless');

This installation method will not work if you are using webpack.

Then add the Sentry Layer by navigating to your Lambda function. Select Layers, then Add a Layer.

Specify an ARN tab as illustrated:

Finally, set the region and copy the provided ARN value into the input.

Select Region

You can also install a v7 version of the Sentry Lambda layer in case you cannot upgrade to v8. Modify and copy the provided ARN value for your region into the input, e.g. for region us-west-1 and the current v7 Lambda layer version 1:

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").