Skip to content

Commit

Permalink
Created new steps to check if there are any running state machine exe…
Browse files Browse the repository at this point in the history
…cutions and stop any concurrent runs.
  • Loading branch information
mbaillergeon-slalom committed Jun 5, 2024
1 parent bbe8c42 commit 2a2e717
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion catalog/aws/singer-taps/step-functions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,32 @@ locals {
"Version": "1.0",
"Comment": "Run Sync (ECS Fargate: ${tap_spec.image})",
"TimeoutSeconds": ${var.timeout_hours * (60 * 60)},
"StartAt": "RunTask",
"StartAt": "ListRunningExecutions",
"States": {
"ListRunningExecutions": {
"Type": "Task",
"Parameters": {
"StateMachineArn.$": "$$.StateMachine.Id",
"StatusFilter": "RUNNING"
},
"Resource": "arn:aws:states:::aws-sdk:sfn:listExecutions",
"Next": "IsExecutionCountGreaterThan1",
"ResultPath": "$.runningExecutionsCount",
"ResultSelector": {
"runningExecutionsCount.$": "States.ArrayLength($.Executions)"
}
},
"IsExecutionCountGreaterThan1": {
"Type": "Choice",
"Choices": [
{
"Variable": "$.runningExecutionsCount.runningExecutionsCount",
"NumericGreaterThan": 1,
"Next": "NotifyOnError"
}
],
"Default": "RunTask"
},
"RunTask": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
Expand Down

0 comments on commit 2a2e717

Please sign in to comment.