-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·36 lines (30 loc) · 862 Bytes
/
deploy.sh
File metadata and controls
executable file
·36 lines (30 loc) · 862 Bytes
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
31
32
33
34
35
36
#!/bin/bash
set -eo pipefail
if [ -z "$1" ]; then
echo "Please provide a function name"
echo "Usage: $0 my_lambda"
exit 1
fi
if [ -z "$2" ]; then
echo "Please provide the arn of the Lambda execution role you would like to use"
echo "Usage: $0 my_lambda"
exit 1
fi
name="$1"
role="$2"
set -u
# Check if the lambda already exists
if aws lambda get-function --function-name "$name" > /dev/null 2>&1
then
aws lambda update-function-code --function-name "$name" --zip-file fileb://bootstrap.zip > /dev/null
else
aws lambda create-function --function-name "$name" \
--handler bootstrap \
--zip-file fileb://bootstrap.zip \
--runtime provided.al2023 \
--role $role \
--environment 'Variables={RUST_BACKTRACE=1}' \
--tracing-config Mode=Active \
> /dev/null
fi
echo "Deployed $name to AWS"