style: フォーマッティング
This commit is contained in:
parent
715027b4d0
commit
0da7efa1ed
@ -1,123 +1,119 @@
|
||||
{
|
||||
"Comment": "MeDaCa データ取込ECSタスク起動 ステートマシン",
|
||||
"StartAt": "params",
|
||||
"States": {
|
||||
"params": {
|
||||
"Type": "Pass",
|
||||
"Parameters": {
|
||||
"sns": {
|
||||
"TopicArn": "arn:aws:sns:#{REGION_AP_NORTHEAST_1}:#{AWS_ACCOUNT_ID}:nds-notice-#{ENV_NAME}"
|
||||
},
|
||||
"ecs": {
|
||||
"LaunchType": "FARGATE",
|
||||
"Cluster.$": "$.InputParams.ClusterName",
|
||||
"TaskDefinition.$": "$.InputParams.TaskName",
|
||||
"NetworkConfiguration": {
|
||||
"AwsvpcConfiguration": {
|
||||
"Subnets.$": "States.Array($.InputParams.SubNetIdApNorthEast1A, $.InputParams.SubNetIdApNorthEast1D)",
|
||||
"SecurityGroups.$": "States.Array($.InputParams.SecurityGroupIdECSAll, $.InputParams.SecurityGroupIdECSDataImport)",
|
||||
"AssignPublicIp": "DISABLED"
|
||||
}
|
||||
},
|
||||
"Overrides": {
|
||||
"ContainerOverrides": [
|
||||
{
|
||||
"Name.$": "$.InputParams.ContainerName",
|
||||
"Environment": [
|
||||
{
|
||||
"Name": "BUCKET_NAME",
|
||||
"Value.$": "$.InputParams.BucketName"
|
||||
},
|
||||
{
|
||||
"Name": "TARGET_KEY",
|
||||
"Value.$": "$.InputParams.TargetKey"
|
||||
},
|
||||
{
|
||||
"Name": "DATA_SOURCE_NAME",
|
||||
"Value.$": "$.InputParams.DataSourceName"
|
||||
},
|
||||
{
|
||||
"Name": "FILE_NAME",
|
||||
"Value.$": "$.InputParams.FileName"
|
||||
},
|
||||
{
|
||||
"Name": "MODE",
|
||||
"Value.$": "$.InputParams.Mode"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
"Comment": "MeDaCa データ取込ECSタスク起動 ステートマシン",
|
||||
"StartAt": "params",
|
||||
"States": {
|
||||
"params": {
|
||||
"Type": "Pass",
|
||||
"Parameters": {
|
||||
"sns": {
|
||||
"TopicArn": "arn:aws:sns:#{REGION_AP_NORTHEAST_1}:#{AWS_ACCOUNT_ID}:nds-notice-#{ENV_NAME}"
|
||||
},
|
||||
"ecs": {
|
||||
"LaunchType": "FARGATE",
|
||||
"Cluster.$": "$.InputParams.ClusterName",
|
||||
"TaskDefinition.$": "$.InputParams.TaskName",
|
||||
"NetworkConfiguration": {
|
||||
"AwsvpcConfiguration": {
|
||||
"Subnets.$": "States.Array($.InputParams.SubNetIdApNorthEast1A, $.InputParams.SubNetIdApNorthEast1D)",
|
||||
"SecurityGroups.$": "States.Array($.InputParams.SecurityGroupIdECSAll, $.InputParams.SecurityGroupIdECSDataImport)",
|
||||
"AssignPublicIp": "DISABLED"
|
||||
}
|
||||
},
|
||||
"Overrides": {
|
||||
"ContainerOverrides": [
|
||||
{
|
||||
"Name.$": "$.InputParams.ContainerName",
|
||||
"Environment": [
|
||||
{
|
||||
"Name": "BUCKET_NAME",
|
||||
"Value.$": "$.InputParams.BucketName"
|
||||
},
|
||||
{
|
||||
"Name": "TARGET_KEY",
|
||||
"Value.$": "$.InputParams.TargetKey"
|
||||
},
|
||||
{
|
||||
"Name": "DATA_SOURCE_NAME",
|
||||
"Value.$": "$.InputParams.DataSourceName"
|
||||
},
|
||||
{
|
||||
"Name": "FILE_NAME",
|
||||
"Value.$": "$.InputParams.FileName"
|
||||
},
|
||||
{
|
||||
"Name": "MODE",
|
||||
"Value.$": "$.InputParams.Mode"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Comment": "パラメータ設定",
|
||||
"ResultPath": "$.params",
|
||||
"Next": "data-import"
|
||||
}
|
||||
},
|
||||
"data-import": {
|
||||
"Type": "Task",
|
||||
"Resource": "arn:aws:states:::ecs:runTask.sync",
|
||||
"Parameters": {
|
||||
"LaunchType.$": "$.params.ecs.LaunchType",
|
||||
"Cluster.$": "$.params.ecs.Cluster",
|
||||
"TaskDefinition.$": "$.params.ecs.TaskDefinition",
|
||||
"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": "CreateImportPendingFile",
|
||||
"ResultPath": "$.result"
|
||||
}
|
||||
],
|
||||
"Next": "Success",
|
||||
"Comment": "データ登録処理"
|
||||
"Comment": "パラメータ設定",
|
||||
"ResultPath": "$.params",
|
||||
"Next": "data-import"
|
||||
},
|
||||
"data-import": {
|
||||
"Type": "Task",
|
||||
"Resource": "arn:aws:states:::ecs:runTask.sync",
|
||||
"Parameters": {
|
||||
"LaunchType.$": "$.params.ecs.LaunchType",
|
||||
"Cluster.$": "$.params.ecs.Cluster",
|
||||
"TaskDefinition.$": "$.params.ecs.TaskDefinition",
|
||||
"NetworkConfiguration.$": "$.params.ecs.NetworkConfiguration",
|
||||
"Overrides.$": "$.params.ecs.Overrides"
|
||||
},
|
||||
"CreateImportPendingFile": {
|
||||
"Type": "Task",
|
||||
"Parameters": {
|
||||
"Body": "",
|
||||
"Bucket.$": "$.InputParams.BucketName",
|
||||
"Key.$": "States.Format('{}.pending-import', $.InputParams.TargetKey)"
|
||||
},
|
||||
"Resource": "arn:aws:states:::aws-sdk:s3:putObject",
|
||||
"Next": "FailedNotice",
|
||||
"Comment": "データ登録保留ファイル作成",
|
||||
"ResultPath": "$.result"
|
||||
"ResultPath": "$.result",
|
||||
"Retry": [
|
||||
{
|
||||
"ErrorEquals": ["States.ALL"],
|
||||
"BackoffRate": 2,
|
||||
"IntervalSeconds": 3,
|
||||
"MaxAttempts": 3
|
||||
}
|
||||
],
|
||||
"Catch": [
|
||||
{
|
||||
"ErrorEquals": ["States.ALL"],
|
||||
"Next": "CreateImportPendingFile",
|
||||
"ResultPath": "$.result"
|
||||
}
|
||||
],
|
||||
"Next": "Success",
|
||||
"Comment": "データ登録処理"
|
||||
},
|
||||
"CreateImportPendingFile": {
|
||||
"Type": "Task",
|
||||
"Parameters": {
|
||||
"Body": "",
|
||||
"Bucket.$": "$.InputParams.BucketName",
|
||||
"Key.$": "States.Format('{}.pending-import', $.InputParams.TargetKey)"
|
||||
},
|
||||
"FailedNotice": {
|
||||
"Type": "Task",
|
||||
"Resource": "arn:aws:states:::sns:publish",
|
||||
"Parameters": {
|
||||
"TopicArn.$": "$.params.sns.TopicArn",
|
||||
"Subject": "データ登録ECSタスク異常通知",
|
||||
"Message.$": "States.Format('【{}】{}のデータ登録が失敗したため、登録中断ファイルを作成しました。\n\n バケット名:{}\n取込ファイルパス:{}\n\n', $.InputParams.DataSourceName, $.InputParams.FileName, $.InputParams.BucketName, $.InputParams.TargetKey)"
|
||||
},
|
||||
"Next": "Fail"
|
||||
"Resource": "arn:aws:states:::aws-sdk:s3:putObject",
|
||||
"Next": "FailedNotice",
|
||||
"Comment": "データ登録保留ファイル作成",
|
||||
"ResultPath": "$.result"
|
||||
},
|
||||
"FailedNotice": {
|
||||
"Type": "Task",
|
||||
"Resource": "arn:aws:states:::sns:publish",
|
||||
"Parameters": {
|
||||
"TopicArn.$": "$.params.sns.TopicArn",
|
||||
"Subject": "データ登録ECSタスク異常通知",
|
||||
"Message.$": "States.Format('【{}】{}のデータ登録が失敗したため、登録中断ファイルを作成しました。\n\n バケット名:{}\n取込ファイルパス:{}\n\n', $.InputParams.DataSourceName, $.InputParams.FileName, $.InputParams.BucketName, $.InputParams.TargetKey)"
|
||||
},
|
||||
"Success": {
|
||||
"Type": "Succeed",
|
||||
"Comment": "正常終了"
|
||||
},
|
||||
"Fail": {
|
||||
"Type": "Fail",
|
||||
"Comment": "異常終了",
|
||||
"Error": "StatusError",
|
||||
"Cause": "StepFunctions ErrorEnd"
|
||||
}
|
||||
"Next": "Fail"
|
||||
},
|
||||
"Success": {
|
||||
"Type": "Succeed",
|
||||
"Comment": "正常終了"
|
||||
},
|
||||
"Fail": {
|
||||
"Type": "Fail",
|
||||
"Comment": "異常終了",
|
||||
"Error": "StatusError",
|
||||
"Cause": "StepFunctions ErrorEnd"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user