-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexecute-machine-track-uptime.sh
More file actions
executable file
·32 lines (23 loc) · 1.06 KB
/
execute-machine-track-uptime.sh
File metadata and controls
executable file
·32 lines (23 loc) · 1.06 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
#!/usr/bin/env bash
# Setup StepFunctions Local
docker-compose up --detach stepfunctionslocal
echo "waiting for StepFunctions Local to report 'Starting server on port' from container stepfunctionslocal"
while [ $(docker-compose logs --tail="all" stepfunctionslocal 2>&1 | grep "Starting server on port" | wc -l) -lt 1 ]; do
echo "waiting for StepFunctions Local.."
sleep 3
done
echo "StepFunctions Local is Ready!"
# Initialize StateMachine
echo "creating state machine"
states_json=$(cat ./statemachines/track-uptime.asl.json)
aws stepfunctions --endpoint http://localhost:8083 create-state-machine \
--name "TrackUptime" \
--role-arn "arn:aws:iam::012345678901:role/DummyRole" \
--definition "$states_json" \
--no-cli-pager
echo "state machine created"
# Execute StateMachine
aws stepfunctions --endpoint http://localhost:8083 start-execution \
--state-machine-arn "arn:aws:states:us-east-1:123456789012:stateMachine:TrackUptime" \
--input '{"url": "https://hackerrdave.com", "querySelector": "#___gatsby", "inverse": false}' \
--no-cli-pager