generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathmakefile
More file actions
79 lines (67 loc) · 3.3 KB
/
makefile
File metadata and controls
79 lines (67 loc) · 3.3 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
run:
docker run -p 8083:8083 \
--mount type=bind,readonly,source=$(ROOT_DIR)/statemachine/test/MockConfigFile.json,destination=/home/StepFunctionsLocal/MockConfigFile.json \
-e SFN_MOCK_CONFIG="/home/StepFunctionsLocal/MockConfigFile.json" \
amazon/aws-stepfunctions-local
create:
aws stepfunctions create-state-machine \
--endpoint-url http://localhost:8083 \
--definition file://statemachine/local_testing.asl.json \
--name "LocalTesting" \
--role-arn "arn:aws:iam::123456789012:role/DummyRole" \
--no-cli-pager
happy:
aws stepfunctions start-execution \
--endpoint http://localhost:8083 \
--name happyPathExecution \
--state-machine arn:aws:states:us-east-1:123456789012:stateMachine:LocalTesting#HappyPathTest \
--input file://events/sfn_valid_input.json \
--no-cli-pager
error:
aws stepfunctions start-execution \
--endpoint http://localhost:8083 \
--name catchCustomErrorExecution \
--state-machine arn:aws:states:us-east-1:123456789012:stateMachine:LocalTesting#CustomValidationFailedCatchTest \
--input file://events/sfn_valid_input.json \
--no-cli-pager
exception:
aws stepfunctions start-execution \
--endpoint http://localhost:8083 \
--name runtimeExceptionExecution \
--state-machine arn:aws:states:us-east-1:123456789012:stateMachine:LocalTesting#ValidationExceptionCatchTest \
--input file://events/sfn_valid_input.json \
--no-cli-pager
retry:
aws stepfunctions start-execution \
--endpoint http://localhost:8083 \
--name retryWithServiceException \
--state-machine arn:aws:states:us-east-1:123456789012:stateMachine:LocalTesting#RetryOnServiceExceptionTest \
--input file://events/sfn_valid_input.json \
--no-cli-pager
all: create happy error exception retry
happy-h:
aws stepfunctions get-execution-history \
--endpoint http://localhost:8083 \
--execution-arn arn:aws:states:us-east-1:123456789012:execution:LocalTesting:happyPathExecution \
--query 'events[?type==`TaskStateExited` && stateExitedEventDetails.name==`CustomerAddedToFollowup`]' \
--no-cli-pager
error-h:
aws stepfunctions get-execution-history \
--endpoint http://localhost:8083 \
--execution-arn arn:aws:states:us-east-1:123456789012:execution:LocalTesting:catchCustomErrorExecution \
--query 'events[?type==`TaskStateEntered` && stateEnteredEventDetails.name==`CustomValidationFailed` && contains(stateEnteredEventDetails.input, `Check Identity Validation Failed`)]' \
--no-cli-pager
exception-h:
aws stepfunctions get-execution-history \
--endpoint http://localhost:8083 \
--execution-arn arn:aws:states:us-east-1:123456789012:execution:LocalTesting:runtimeExceptionExecution \
--query 'events[?type==`TaskStateEntered` && stateEnteredEventDetails.name==`ValidationException` && contains(stateEnteredEventDetails.input, `Address Validation Exception`)]' \
--no-cli-pager
retry-h:
aws stepfunctions get-execution-history \
--endpoint http://localhost:8083 \
--execution-arn arn:aws:states:us-east-1:123456789012:execution:LocalTesting:retryWithServiceException \
--query 'events[?(type==`TaskFailed` && taskFailedEventDetails.error==`InternalServerException`) || (type==`TaskSucceeded` && taskSucceededEventDetails.resource==`comprehend:detectSentiment`)]' \
--no-cli-pager
history: happy-h error-h exception-h retry-h