-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathdeploy-lambda.sh
More file actions
executable file
·24 lines (18 loc) · 947 Bytes
/
deploy-lambda.sh
File metadata and controls
executable file
·24 lines (18 loc) · 947 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
#!/bin/bash
set -euo pipefail
FUNCTION_NAME="${1:?Usage: deploy-lambda.sh <function-name>}"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Install the published temporalio package (Linux wheels) with the OTel extras
# needed by the lambda_worker contrib module
uv pip install --target "$SCRIPT_DIR/package" --python-platform x86_64-unknown-linux-gnu \
--only-binary=:all: "temporalio[lambda-worker-otel]"
# Copy application code into the package directory (all at zip root)
cp "$SCRIPT_DIR/lambda_function.py" "$SCRIPT_DIR/workflows.py" \
"$SCRIPT_DIR/activities.py" "$SCRIPT_DIR/package/"
# Bundle with configuration files
cd "$SCRIPT_DIR/package"
zip -r "$SCRIPT_DIR/function.zip" .
cd "$SCRIPT_DIR"
zip function.zip client.pem client.key temporal.toml otel-collector-config.yaml
aws lambda update-function-code --function-name "$FUNCTION_NAME" --zip-file fileb://function.zip
rm -rf "$SCRIPT_DIR/package" "$SCRIPT_DIR/function.zip"