Unable to use the Lambda Layer
Closed this issue · 1 comments
danReleases commented
Environment
How do you use Sentry?
Sentry SaaS (sentry.io)
Steps to Reproduce
- Using the documentation, I tried adding the sentry layer to my lambda function. The arn provided for eu-west-2 is: arn:aws:lambda:eu-west-2:943013980633:layer:SentryPythonServerlessSDK:24
Expected Result
- I expected to run sentry out of the box.
Actual Result
- While I am able to initially import the layer, when I go on edit mode, it reads "This layer no longer exists. You must remove this layer from the list before you can save any changes.".
- When I try to run
import sentry
on my lambda function, it saysNo module named 'sentry'
.
I suspect the layer version is incorrect on the documentation but I have been unable to find any information on this.
danReleases commented
Ok, so this happened because I was trying to import 'sentry' instead of 'sentry_sdk'.
The correct code is:
import sentry_sdk
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
Hope this helps someone else!