From a5d48cbff8e85b71d86b2ab8a103a74267e1dd08 Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Fri, 21 Apr 2023 17:12:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=97=A5=E6=AC=A1dump=E5=8F=96?= =?UTF-8?q?=E5=BE=97=E3=81=AE=E3=82=B9=E3=83=86=E3=83=BC=E3=83=88=E3=83=9E?= =?UTF-8?q?=E3=82=B7=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stepfunctions/TOOLS/convert_config.yaml | 30 ++++++++ .../r-jskult-batch-daily-state.json | 2 +- .../r-jskult-batch-monthly-state.json | 2 +- .../r-jskult-dbdump-state.json | 72 +++++++++++++++++++ 4 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 stepfunctions/r-jskult-dbdump-state/r-jskult-dbdump-state.json diff --git a/stepfunctions/TOOLS/convert_config.yaml b/stepfunctions/TOOLS/convert_config.yaml index ef81ab5e..172bfbbd 100644 --- a/stepfunctions/TOOLS/convert_config.yaml +++ b/stepfunctions/TOOLS/convert_config.yaml @@ -152,3 +152,33 @@ config: SG_ECS_ALL: *PRD_SG_ECS_ALL # セキュリティグループ(ecs-jskut-batch-daily) SG_JSKULT_BATCH_MONTHLY: *PRD_SG_JSKULT_BATCH_MONTHLY + # 実消化&アルトマーク 日次dump取得 + r-jskult-dbdump-state: + # ステージング環境 + staging: + # AWSアカウントID + AWS_ACCOUNT_ID: *AWS_ACCOUNT_ID + # 東京リージョン + REGION_AP_NORTHEAST_1: *REGION_AP_NORTHEAST_1 + # サブネット(PrivateSubnet1) + SUBNET_PRI_1A: *STG_SUBNET_PRI_1A + # サブネット(PrivateSubnet2) + SUBNET_PRI_1D: *STG_SUBNET_PRI_1D + # セキュリティグループ(ecs-all) + SG_ECS_ALL: *STG_SG_ECS_ALL + # セキュリティグループ(ecs-jskut-dbdump) + SG_JSKULT_DBDUMP: *STG_SG_JSKULT_DBDUMP + # 本番環境 + product: + # AWSアカウントID + AWS_ACCOUNT_ID: *AWS_ACCOUNT_ID + # 東京リージョン + REGION_AP_NORTHEAST_1: *REGION_AP_NORTHEAST_1 + # サブネット(PrivateSubnet1) + SUBNET_PRI_1A: *PRD_SUBNET_PRI_1A + # サブネット(PrivateSubnet2) + SUBNET_PRI_1D: *PRD_SUBNET_PRI_1D + # セキュリティグループ(ecs-all) + SG_ECS_ALL: *PRD_SG_ECS_ALL + # セキュリティグループ(ecs-jskut-dbdump) + SG_JSKULT_DBDUMP: *PRD_SG_JSKULT_DBDUMP diff --git a/stepfunctions/r-jskult-batch-daily-state/r-jskult-batch-daily-state.json b/stepfunctions/r-jskult-batch-daily-state/r-jskult-batch-daily-state.json index 10f36de2..07964c60 100644 --- a/stepfunctions/r-jskult-batch-daily-state/r-jskult-batch-daily-state.json +++ b/stepfunctions/r-jskult-batch-daily-state/r-jskult-batch-daily-state.json @@ -31,7 +31,7 @@ "Next": "exec-batch-daily" }, "exec-batch-daily": { - "Comment": "実消化&アルトマーク 日次バッチ", + "Comment": "実消化&アルトマーク 日次バッチ起動", "Type": "Task", "Resource": "arn:aws:states:::ecs:runTask.sync", "Parameters": { diff --git a/stepfunctions/r-jskult-batch-monthly-state/r-jskult-batch-monthly-state.json b/stepfunctions/r-jskult-batch-monthly-state/r-jskult-batch-monthly-state.json index e149bc4a..468127bc 100644 --- a/stepfunctions/r-jskult-batch-monthly-state/r-jskult-batch-monthly-state.json +++ b/stepfunctions/r-jskult-batch-monthly-state/r-jskult-batch-monthly-state.json @@ -31,7 +31,7 @@ "Next": "exec-batch-monthly" }, "exec-batch-monthly": { - "Comment": "実消化&アルトマーク 日次バッチ", + "Comment": "実消化&アルトマーク 月次バッチ起動", "Type": "Task", "Resource": "arn:aws:states:::ecs:runTask.sync", "Parameters": { diff --git a/stepfunctions/r-jskult-dbdump-state/r-jskult-dbdump-state.json b/stepfunctions/r-jskult-dbdump-state/r-jskult-dbdump-state.json new file mode 100644 index 00000000..dbcfb4b4 --- /dev/null +++ b/stepfunctions/r-jskult-dbdump-state/r-jskult-dbdump-state.json @@ -0,0 +1,72 @@ +{ + "Comment": "MeDaCA 実消化&アルトマーク 日次dump取得ステートマシン", + "StartAt": "params", + "States": { + "params": { + "Comment": "パラメータ設定", + "Type": "Pass", + "Parameters": { + "sns": { + "TopicArn": "arn:aws:sns:#{REGION_AP_NORTHEAST_1}:#{AWS_ACCOUNT_ID}:nds-notice-#{ENV_NAME}" + }, + "ecs": { + "Cluster": "arn:aws:ecs:#{REGION_AP_NORTHEAST_1}:#{AWS_ACCOUNT_ID}:cluster/mbj-newdwh2021-#{ENV_NAME}-jskult-dbdump-ecs", + "LaunchType": "FARGATE", + "NetworkConfiguration": { + "AwsvpcConfiguration": { + "Subnets": [ + "#{SUBNET_PRI_1A}", + "#{SUBNET_PRI_1D}" + ], + "SecurityGroups": [ + "#{SG_ECS_ALL}", + "#{SG_JSKULT_DBDUMP}" + ], + "AssignPublicIp": "DISABLED" + } + } + } + }, + "ResultPath": "$.params", + "Next": "exec-batch-monthly" + }, + "exec-batch-monthly": { + "Comment": "実消化&アルトマーク 日次dump取得起動", + "Type": "Task", + "Resource": "arn:aws:states:::ecs:runTask.sync", + "Parameters": { + "Cluster.$": "$.params.ecs.Cluster", + "LaunchType.$": "$.params.ecs.LaunchType", + "TaskDefinition": "arn:aws:ecs:#{REGION_AP_NORTHEAST_1}:#{AWS_ACCOUNT_ID}:task-definition/mbj-newdwh2021-#{ENV_NAME}-task-jskult-dbdump", + "NetworkConfiguration.$": "$.params.ecs.NetworkConfiguration" + }, + "Retry": [ + { + "ErrorEquals": ["States.ALL"], + "BackoffRate": 2, + "IntervalSeconds": 5, + "MaxAttempts": 3 + } + ], + "Catch": [ + { + "ErrorEquals": ["States.ALL"], + "ResultPath": "$.result", + "Next": "ErrorEnd" + } + ], + "ResultPath": "$.result", + "Next": "NormalEnd" + }, + "NormalEnd": { + "Comment": "正常終了", + "Type": "Succeed" + }, + "ErrorEnd": { + "Comment": "異常終了", + "Type": "Fail", + "Error": "StatesError", + "Cause": "StepFunctions ErrorEnd" + } + } +}