Skip to content

Commit 8a8c1e3

Browse files
committed
Added script to attach layer to function
1 parent 4afe6d8 commit 8a8c1e3

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
FUNCTION_NAME=$1
6+
7+
echo "Getting ARN of newest Sentry lambda layer..."
8+
LAYER_ARN=$(aws lambda list-layer-versions --layer-name SentryPythonServerlessSDKLocalDev --query "LayerVersions[0].LayerVersionArn" | tr -d '"')
9+
echo "Done getting ARN of newest Sentry lambda layer $LAYER_ARN."
10+
11+
echo "Attaching Lamba layer to function $FUNCTION_NAME..."
12+
aws lambda update-function-configuration --function-name "$FUNCTION_NAME" --layers "$LAYER_ARN" --no-cli-pager
13+
echo "Done attaching Lamba layer to function $FUNCTION_NAME."
14+
15+
echo "All done. Have a nice day!"

0 commit comments

Comments
 (0)