Invoking the Step Function using the API Gateway. Configuring the API Gateway Integration settings, for AWS Service it must be Step Function
, for Action Type, you must use the Use action name
and enter the StartSyncExecution
for Action.
{
"StartAt": "Pass",
"States": {
"Pass": {
"Type": "Pass",
"End": true
}
}
}
{
"input": "{}",
"name": "MyExecution"
}
{
"billingDetails": {
"billedDurationInMilliseconds": 100,
"billedMemoryUsedInMB": 64
},
"executionArn": "arn:aws:states:us-east-1:123456789101:express:sf-state-machine:1fe234a5-d61a-7891-0cdf-11121d3141b5:1efa2345-b678-9101-1ade-12f1ed314ccc",
"input": "{\"input\":\"{}\",\"name\":\"MyExecution\"}",
"inputDetails": {
"__type": "com.amazonaws.swf.base.model#CloudWatchEventsExecutionDataDetails",
"included": true
},
"name": "1fe234a5-d61a-7891-0cdf-11121d3141b5",
"output": "{\"input\":\"{}\",\"name\":\"MyExecution\"}",
"outputDetails": {
"__type": "com.amazonaws.swf.base.model#CloudWatchEventsExecutionDataDetails",
"included": true
},
"startDate": 1.683799126827E9,
"stateMachineArn": "arn:aws:states:us-east-1:123456789101:stateMachine:sf-state-machine",
"status": "SUCCEEDED",
"stopDate": 1.683799126837E9,
"traceHeader": "Root=1-234cbc56-78eecf9101bc112f131e41a5;Parent=12d345678d9d10dd;Sampled=1"
}
- States
- StartExecution
- Amazon States Language
- AWS Step Function Guides
- Input and Output Processing in Step Functions
- Creating a Step Functions API Using API Gateway
- API Gateway mapping template and access logging variable reference
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template
-
Install all the dependencies, bootstrap your project, and synthesized CloudFormation template.
# Without passing "profile" parameter dev@dev:~:aws-cdk-samples/step-functions/step-functions-api-gateway$ make init # With "profile" parameter dev@dev:~:aws-cdk-samples/step-functions/step-functions-api-gateway$ make init profile=[profile_name]
-
Deploy the project.
# Without passing "profile" parameter dev@dev:~:aws-cdk-samples/step-functions/step-functions-api-gateway$ make deploy # With "profile" parameter dev@dev:~:aws-cdk-samples/step-functions/step-functions-api-gateway$ make deploy profile=[profile_name]