TESTING SCENARIOS CLI COMMANDS -------------------------------------------------- Using your text editor, replace the state-machine-arn and region parameters. 1 - ErrProcessOrder ------------------------- aws stepfunctions start-execution \ --state-machine-arn "arn:aws:states:[REGION]:[ACCOUNT NUMBER]:stateMachine:[STATEMACHINE-NAME]" \ --input "{\"order_id\": \"1ae4501d-ed92-4b27-bf0e-fd978ed45127\", \"order_date\": \"2018-10-19T10:50:16+08:00\", \"customer_id\": \"0d52eeef-52a1-4e6e-a5b1-d0515121306c\", \"items\": [{ \"item_id\": \"929\", \"qty\": 3.0, \"description\": \"Cart item 1\", \"unit_price\": 9.99 }]}" \ --region [AWS_REGION] 11 - ErrUpdateOrderStatus ------------------------- aws stepfunctions start-execution \ --state-machine-arn "arn:aws:states:[REGION]:[ACCOUNT NUMBER]:stateMachine:[STATEMACHINE-NAME]" \ --input "{\"order_id\": \"11328abd-368d-43fd-bd4f-db15b5b63951\", \"order_date\": \"2018-10-19T10:50:16+08:00\", \"customer_id\": \"8d04ea6f-c6b2-4422-8550-839a16f01feb\", \"items\": [{ \"item_id\": \"567\", \"qty\": 1.0, \"description\": \"Cart item 1\", \"unit_price\": 199.99 }]}" \ --region [AWS_REGION] 2 - ErrProcessPayment ------------------------- aws stepfunctions start-execution \ --state-machine-arn "arn:aws:states:[REGION]:[ACCOUNT NUMBER]:stateMachine:[STATEMACHINE-NAME]" \ --input "{\"order_id\": \"20b0b599-441b-45c3-910e-ad63fe992c43\", \"order_date\": \"2018-10-19T10:50:16+08:00\", \"customer_id\": \"151ae48f-79b0-47b6-a8a6-bd8dbcf9af9a\", \"items\": [{ \"item_id\": \"423\", \"qty\": 10.0, \"description\": \"Cart item 1\", \"unit_price\": 34.99 }]}" \ --region [AWS_REGION] 22 - ErrProcessRefund ------------------------- aws stepfunctions start-execution \ --state-machine-arn "arn:aws:states:[REGION]:[ACCOUNT NUMBER]:stateMachine:[STATEMACHINE-NAME]" \ --input "{\"order_id\": \"222f741b-0292-4f93-a2f7-503f92486955 \", \"order_date\": \"2018-10-19T10:50:16+08:00\", \"customer_id\": \"227dd3c9-58ab-4f0d-958a-5ead5858fba8\", \"items\": [{ \"item_id\": \"655\", \"qty\": 2.0, \"description\": \"Cart item 1\", \"unit_price\": 99.99 }]}" \ --region [AWS_REGION] 3 - ErrReserveInventory ------------------------- aws stepfunctions start-execution \ --state-machine-arn "arn:aws:states:[REGION]:[ACCOUNT NUMBER]:stateMachine:[STATEMACHINE-NAME]" \ --input "{\"order_id\": \"3a7dc768-6f32-495d-a140-3d330c246f50\", \"order_date\": \"2018-10-19T10:50:16+08:00\", \"customer_id\": \"aa226136-bd50-4718-8e87-6962c8d34779\", \"items\": [{ \"item_id\": \"765\", \"qty\": 1.0, \"description\": \"Cart item 1\", \"unit_price\": 6.50 }]}" \ --region [AWS_REGION] 33 - ErrReleaseInventory ------------------------- aws stepfunctions start-execution \ --state-machine-arn "arn:aws:states:[REGION]:[ACCOUNT NUMBER]:stateMachine:[STATEMACHINE-NAME]" \ --input "{\"order_id\": \"33a49007-a815-4079-9b9b-e30ae7eca11f\", \"order_date\": \"2018-10-19T10:50:16+08:00\", \"customer_id\": \"39081ebf-16a9-4e2c-a88b-d1a4c76956fd\", \"items\": [{ \"item_id\": \"567\", \"qty\": 1.0, \"description\": \"Cart item 1\", \"unit_price\": 199.99 }]}" \ --region [AWS_REGION] 4 to 9 - No error ------------------------- aws stepfunctions start-execution \ --state-machine-arn "arn:aws:states:[REGION]:[ACCOUNT NUMBER]:stateMachine:[STATEMACHINE-NAME]" \ --input "{\"order_id\": \"47063fe3-56d9-4c51-b91f-71929834ce03\", \"order_date\": \"2018-10-19T10:50:16+08:00\", \"customer_id\": \"3b27c7c4-7a3e-4635-aef9-6b5c74de6465\", \"items\": [{ \"item_id\": \"988\", \"qty\": 100.0, \"description\": \"Cart item 1\", \"unit_price\": 0.99 }]}" \ --region [AWS_REGION]