forked from getsentry/sentry-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaws-deploy-local-layer.sh
executable file
·30 lines (24 loc) · 1.04 KB
/
aws-deploy-local-layer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
#
# Builds and deploys the Sentry AWS Lambda layer (including the Sentry SDK and the Sentry Lambda Extension)
#
# The currently checked out version of the SDK in your local directory is used.
# The latest version of the Lambda Extension is fetched from the Sentry Release Registry.
#
set -euo pipefail
# Creating Lambda layer
echo "Creating Lambda layer in ./dist ..."
make aws-lambda-layer
echo "Done creating Lambda layer in ./dist"
# Deploying zipped Lambda layer to AWS
ZIP=$(ls dist | grep serverless | head -n 1)
echo "Deploying zipped Lambda layer $ZIP to AWS..."
aws lambda publish-layer-version \
--layer-name "SentryPythonServerlessSDK-local-dev" \
--region "eu-central-1" \
--zip-file "fileb://dist/$ZIP" \
--description "Local test build of SentryPythonServerlessSDK (can be deleted)" \
--compatible-runtimes python3.7 python3.8 python3.9 python3.10 python3.11 \
--no-cli-pager
echo "Done deploying zipped Lambda layer to AWS as 'SentryPythonServerlessSDK-local-dev'."
echo "All done. Have a nice day!"