-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinvoke-workflow.sh
More file actions
executable file
·40 lines (33 loc) · 1 KB
/
invoke-workflow.sh
File metadata and controls
executable file
·40 lines (33 loc) · 1 KB
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
37
38
39
40
#!/bin/bash
# Script to invoke BOPSParallelMainHandler Lambda function
# Uses invoke-workflow-payload.json as the payload
set -e # Exit on any error
FUNCTION_NAME="BOPSParallelMainHandler"
PAYLOAD_FILE="invoke-workflow-payload.json"
OUTPUT_FILE="lambda-response.json"
echo "Invoking Lambda function: $FUNCTION_NAME"
echo "Using payload from: $PAYLOAD_FILE"
# Check if payload file exists
if [ ! -f "$PAYLOAD_FILE" ]; then
echo "Error: Payload file '$PAYLOAD_FILE' not found!"
exit 1
fi
# Invoke the Lambda function
echo "Executing Lambda invocation..."
aws lambda invoke \
--function-name "$FUNCTION_NAME" \
--payload "file://$PAYLOAD_FILE" \
--cli-binary-format raw-in-base64-out \
"$OUTPUT_FILE"
# Check if invocation was successful
if [ $? -eq 0 ]; then
echo "Lambda invocation completed successfully!"
echo "Response saved to: $OUTPUT_FILE"
echo ""
echo "Response content:"
cat "$OUTPUT_FILE"
echo ""
else
echo "Error: Lambda invocation failed!"
exit 1
fi