newdwh2021/stepfunctions/r-jskult-batch-ultmarc-io-state/r-jskult-batch-ultmarc-io-state.json

88 lines
2.5 KiB
JSON

{
"Comment": "MeDaCa 実消化&アルトマーク アルトマーク取込/データ出力ECSタスク起動 ステートマシン",
"StartAt": "params",
"States": {
"params": {
"Type": "Pass",
"Parameters": {
"ecs": {
"LaunchType": "FARGATE",
"Cluster": "arn:aws:ecs:#{REGION_AP_NORTHEAST_1}:#{AWS_ACCOUNT_ID}:cluster/mbj-newdwh2021-#{ENV_NAME}-jskult-batch-ultmarc-io-ecs",
"NetworkConfiguration": {
"AwsvpcConfiguration": {
"Subnets": [
"#{SUBNET_PRI_1A}",
"#{SUBNET_PRI_1D}"
],
"SecurityGroups": [
"#{SG_ECS_ALL}",
"#{SG_JSKULT_ULTMARC_IO}"
],
"AssignPublicIp": "DISABLED"
}
},
"Overrides": {
"ContainerOverrides": [
{
"Name": "mbj-newdwh2021-#{ENV_NAME}-container-jskult-batch-ultmarc-io",
"Environment": [
{
"Name": "IMPORT_FILE_KEY",
"Value.$": "$.InputParams.TargetKey"
}
]
}
]
}
}
},
"Comment": "パラメータ設定",
"ResultPath": "$.params",
"Next": "exec-ecs-task"
},
"exec-ecs-task": {
"Type": "Task",
"Resource": "arn:aws:states:::ecs:runTask.sync",
"Parameters": {
"LaunchType.$": "$.params.ecs.LaunchType",
"Cluster.$": "$.params.ecs.Cluster",
"TaskDefinition": "arn:aws:ecs:#{REGION_AP_NORTHEAST_1}:#{AWS_ACCOUNT_ID}:task-definition/mbj-newdwh2021-#{ENV_NAME}-task-jskult-batch-ultmarc-io",
"NetworkConfiguration.$": "$.params.ecs.NetworkConfiguration",
"Overrides.$": "$.params.ecs.Overrides"
},
"ResultPath": "$.result",
"Retry": [
{
"ErrorEquals": [
"States.ALL"
],
"BackoffRate": 2,
"IntervalSeconds": 3,
"MaxAttempts": 3
}
],
"Catch": [
{
"ErrorEquals": [
"States.ALL"
],
"Next": "Fail",
"ResultPath": "$.result"
}
],
"Next": "Success",
"Comment": "アルトマーク取込/データ出力処理起動"
},
"Success": {
"Type": "Succeed",
"Comment": "正常終了"
},
"Fail": {
"Type": "Fail",
"Comment": "異常終了",
"Error": "StatusError",
"Cause": "StepFunctions ErrorEnd"
}
}
}