From 3bdc7495b5b65e16def9fc1907c2b74216cef82a Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Fri, 21 Apr 2023 16:28:47 +0900 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20=E6=97=A5=E6=AC=A1=E3=83=90?= =?UTF-8?q?=E3=83=83=E3=83=81=E3=81=AEStepFunctions=E3=82=92=E4=BD=9C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stepfunctions/TOOLS/convert_config.yaml | 47 +++++++++++- .../r-jskult-batch-daily-state.json | 72 +++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 stepfunctions/r-jskult-batch-daily-state/r-jskult-batch-daily-state.json diff --git a/stepfunctions/TOOLS/convert_config.yaml b/stepfunctions/TOOLS/convert_config.yaml index be3baa0e..b2822e23 100644 --- a/stepfunctions/TOOLS/convert_config.yaml +++ b/stepfunctions/TOOLS/convert_config.yaml @@ -20,6 +20,14 @@ resource: - &STG_SG_ECS_ALL "sg-051e0fb9925539592" # セキュリティグループ(ecs-crm-datafetch) - &STG_SG_CRM_DATAFETCH "sg-0b20b7bb1cb1ab886" + # セキュリティグループ(ecs-jskult-batch-daily) + - &STG_SG_JSKULT_BATCH_DAILY "sg-020b3f6a5a6d6a3a0" + # セキュリティグループ(ecs-jskult-batch-monthly) + - &STG_SG_JSKULT_BATCH_MONTHLY "sg-05c7ad620d69e6f5f" + # セキュリティグループ(ecs-jskult-dbdump) + - &STG_SG_JSKULT_DBDUMP "sg-0967779af13538a8e" + # セキュリティグループ(ecs-jskult-batch-laundering) + - &STG_SG_JSKULT_BATCH_LAUNDERING "sg-00b9ea30c5c6bb77a" # 本番環境 product: # サブネット(PrivateSubnet1) @@ -30,7 +38,15 @@ resource: - &PRD_SG_ECS_ALL "sg-05df4823fc789b0fa" # セキュリティグループ(ecs-crm-datafetch) - &PRD_SG_CRM_DATAFETCH "sg-04de7fc3357d852af" - + # TODO: 本番リリース時にIDを正式化する + # セキュリティグループ(ecs-jskult-batch-daily) + - &PRD_SG_JSKULT_BATCH_DAILY "sg-xxxxxxxxxxxxxxxx" + # セキュリティグループ(ecs-jskult-batch-monthly) + - &PRD_SG_JSKULT_BATCH_MONTHLY "sg-xxxxxxxxxxxxxxxx" + # セキュリティグループ(ecs-jskult-dbdump) + - &PRD_SG_JSKULT_DBDUMP "sg-xxxxxxxxxxxxxxxx" + # セキュリティグループ(ecs-jskult-batch-laundering) + - &PRD_SG_JSKULT_BATCH_LAUNDERING "sg-xxxxxxxxxxxxxxxx" config: r-crm-datafetch-state: # ステージング環境 @@ -74,3 +90,32 @@ config: AWS_ACCOUNT_ID: *AWS_ACCOUNT_ID # 東京リージョン REGION_AP_NORTHEAST_1: *REGION_AP_NORTHEAST_1 + r-jskult-batch-daily-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-crm-datafetch) + SG_JSKULT_BATCH_DAILY: *STG_SG_JSKULT_BATCH_DAILY + # 本番環境 + 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-crm-datafetch) + SG_JSKULT_BATCH_DAILY: *PRD_SG_JSKULT_BATCH_DAILY 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 new file mode 100644 index 00000000..10f36de2 --- /dev/null +++ b/stepfunctions/r-jskult-batch-daily-state/r-jskult-batch-daily-state.json @@ -0,0 +1,72 @@ +{ + "Comment": "MeDaCA 実消化&アルトマーク 日次バッチ起動ステートマシン", + "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-batch-daily-ecs", + "LaunchType": "FARGATE", + "NetworkConfiguration": { + "AwsvpcConfiguration": { + "Subnets": [ + "#{SUBNET_PRI_1A}", + "#{SUBNET_PRI_1D}" + ], + "SecurityGroups": [ + "#{SG_ECS_ALL}", + "#{SG_JSKULT_BATCH_DAILY}" + ], + "AssignPublicIp": "DISABLED" + } + } + } + }, + "ResultPath": "$.params", + "Next": "exec-batch-daily" + }, + "exec-batch-daily": { + "Comment": "実消化&アルトマーク 日次バッチ", + "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-batch-daily", + "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" + } + } +} From b52f8e6611812c6dbaaefcb94cfd72a2837b9876 Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Fri, 21 Apr 2023 16:37:27 +0900 Subject: [PATCH 2/4] =?UTF-8?q?feat:=20=E6=9C=88=E6=AC=A1=E3=83=90?= =?UTF-8?q?=E3=83=83=E3=83=81=E3=81=AE=E3=82=B9=E3=83=86=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=83=9E=E3=82=B7=E3=83=B3=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stepfunctions/TOOLS/convert_config.yaml | 37 +++++++++- .../r-jskult-batch-monthly-state.json | 72 +++++++++++++++++++ 2 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 stepfunctions/r-jskult-batch-monthly-state/r-jskult-batch-monthly-state.json diff --git a/stepfunctions/TOOLS/convert_config.yaml b/stepfunctions/TOOLS/convert_config.yaml index b2822e23..ef81ab5e 100644 --- a/stepfunctions/TOOLS/convert_config.yaml +++ b/stepfunctions/TOOLS/convert_config.yaml @@ -48,6 +48,7 @@ resource: # セキュリティグループ(ecs-jskult-batch-laundering) - &PRD_SG_JSKULT_BATCH_LAUNDERING "sg-xxxxxxxxxxxxxxxx" config: + # CRMデータ取得 r-crm-datafetch-state: # ステージング環境 staging: @@ -77,6 +78,7 @@ config: SG_ECS_ALL: *PRD_SG_ECS_ALL # セキュリティグループ(ecs-crm-datafetch) SG_CRM_DATAFETCH: *PRD_SG_CRM_DATAFETCH + # データ登録処理 r-data-import-state: # ステージング環境 staging: @@ -90,6 +92,7 @@ config: AWS_ACCOUNT_ID: *AWS_ACCOUNT_ID # 東京リージョン REGION_AP_NORTHEAST_1: *REGION_AP_NORTHEAST_1 + # 実消化&アルトマーク 日次バッチ r-jskult-batch-daily-state: # ステージング環境 staging: @@ -103,7 +106,7 @@ config: SUBNET_PRI_1D: *STG_SUBNET_PRI_1D # セキュリティグループ(ecs-all) SG_ECS_ALL: *STG_SG_ECS_ALL - # セキュリティグループ(ecs-crm-datafetch) + # セキュリティグループ(ecs-jskut-batch-daily) SG_JSKULT_BATCH_DAILY: *STG_SG_JSKULT_BATCH_DAILY # 本番環境 product: @@ -117,5 +120,35 @@ config: SUBNET_PRI_1D: *PRD_SUBNET_PRI_1D # セキュリティグループ(ecs-all) SG_ECS_ALL: *PRD_SG_ECS_ALL - # セキュリティグループ(ecs-crm-datafetch) + # セキュリティグループ(ecs-jskut-batch-daily) SG_JSKULT_BATCH_DAILY: *PRD_SG_JSKULT_BATCH_DAILY + # 実消化&アルトマーク 月次バッチ + r-jskult-batch-monthly-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-batch-daily) + SG_JSKULT_BATCH_MONTHLY: *STG_SG_JSKULT_BATCH_MONTHLY + # 本番環境 + 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-batch-daily) + SG_JSKULT_BATCH_MONTHLY: *PRD_SG_JSKULT_BATCH_MONTHLY 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 new file mode 100644 index 00000000..e149bc4a --- /dev/null +++ b/stepfunctions/r-jskult-batch-monthly-state/r-jskult-batch-monthly-state.json @@ -0,0 +1,72 @@ +{ + "Comment": "MeDaCA 実消化&アルトマーク 月次バッチ起動ステートマシン", + "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-batch-monthly-ecs", + "LaunchType": "FARGATE", + "NetworkConfiguration": { + "AwsvpcConfiguration": { + "Subnets": [ + "#{SUBNET_PRI_1A}", + "#{SUBNET_PRI_1D}" + ], + "SecurityGroups": [ + "#{SG_ECS_ALL}", + "#{SG_JSKULT_BATCH_MONTHLY}" + ], + "AssignPublicIp": "DISABLED" + } + } + } + }, + "ResultPath": "$.params", + "Next": "exec-batch-monthly" + }, + "exec-batch-monthly": { + "Comment": "実消化&アルトマーク 日次バッチ", + "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-batch-monthly", + "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" + } + } +} 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 3/4] =?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" + } + } +} From efdc0a0a2398f1c616a120d8a38f377242a00576 Mon Sep 17 00:00:00 2001 From: "shimoda.m@nds-tyo.co.jp" Date: Fri, 21 Apr 2023 17:42:43 +0900 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=E5=AE=9F=E7=B8=BE=E5=85=A8?= =?UTF-8?q?=E4=BB=B6=E6=B4=97=E6=9B=BF=E3=83=90=E3=83=83=E3=83=81=E3=81=AE?= =?UTF-8?q?=E3=82=B9=E3=83=86=E3=83=BC=E3=83=88=E3=83=9E=E3=82=B7=E3=83=B3?= =?UTF-8?q?=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stepfunctions/TOOLS/convert_config.yaml | 34 ++++++++- .../r-jskult-batch-laundering-state.json | 72 +++++++++++++++++++ .../r-jskult-dbdump-state.json | 4 +- 3 files changed, 106 insertions(+), 4 deletions(-) create mode 100644 stepfunctions/r-jskult-batch-laundering-state/r-jskult-batch-laundering-state.json diff --git a/stepfunctions/TOOLS/convert_config.yaml b/stepfunctions/TOOLS/convert_config.yaml index 172bfbbd..c68ae70a 100644 --- a/stepfunctions/TOOLS/convert_config.yaml +++ b/stepfunctions/TOOLS/convert_config.yaml @@ -136,7 +136,7 @@ config: SUBNET_PRI_1D: *STG_SUBNET_PRI_1D # セキュリティグループ(ecs-all) SG_ECS_ALL: *STG_SG_ECS_ALL - # セキュリティグループ(ecs-jskut-batch-daily) + # セキュリティグループ(ecs-jskut-batch-monthly) SG_JSKULT_BATCH_MONTHLY: *STG_SG_JSKULT_BATCH_MONTHLY # 本番環境 product: @@ -150,7 +150,7 @@ config: SUBNET_PRI_1D: *PRD_SUBNET_PRI_1D # セキュリティグループ(ecs-all) SG_ECS_ALL: *PRD_SG_ECS_ALL - # セキュリティグループ(ecs-jskut-batch-daily) + # セキュリティグループ(ecs-jskut-batch-monthly) SG_JSKULT_BATCH_MONTHLY: *PRD_SG_JSKULT_BATCH_MONTHLY # 実消化&アルトマーク 日次dump取得 r-jskult-dbdump-state: @@ -182,3 +182,33 @@ config: SG_ECS_ALL: *PRD_SG_ECS_ALL # セキュリティグループ(ecs-jskut-dbdump) SG_JSKULT_DBDUMP: *PRD_SG_JSKULT_DBDUMP + # 実消化&アルトマーク 実績洗替バッチ + r-jskult-batch-laundering-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-batch-laundering) + SG_JSKULT_BATCH_LAUNDERING: *STG_SG_JSKULT_BATCH_LAUNDERING + # 本番環境 + 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-batch-laundering) + SG_JSKULT_BATCH_LAUNDERING: *STG_SG_JSKULT_BATCH_LAUNDERING diff --git a/stepfunctions/r-jskult-batch-laundering-state/r-jskult-batch-laundering-state.json b/stepfunctions/r-jskult-batch-laundering-state/r-jskult-batch-laundering-state.json new file mode 100644 index 00000000..c720e349 --- /dev/null +++ b/stepfunctions/r-jskult-batch-laundering-state/r-jskult-batch-laundering-state.json @@ -0,0 +1,72 @@ +{ + "Comment": "MeDaCA 実消化&アルトマーク 実績全件洗替バッチ起動ステートマシン", + "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-batch-laundering-ecs", + "LaunchType": "FARGATE", + "NetworkConfiguration": { + "AwsvpcConfiguration": { + "Subnets": [ + "#{SUBNET_PRI_1A}", + "#{SUBNET_PRI_1D}" + ], + "SecurityGroups": [ + "#{SG_ECS_ALL}", + "#{SG_JSKULT_BATCH_LAUNDERING}" + ], + "AssignPublicIp": "DISABLED" + } + } + } + }, + "ResultPath": "$.params", + "Next": "exec-batch-laundering" + }, + "exec-batch-laundering": { + "Comment": "実消化&アルトマーク 実績全件洗替バッチ起動", + "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-batch-laundering", + "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" + } + } +} diff --git a/stepfunctions/r-jskult-dbdump-state/r-jskult-dbdump-state.json b/stepfunctions/r-jskult-dbdump-state/r-jskult-dbdump-state.json index dbcfb4b4..47fc9208 100644 --- a/stepfunctions/r-jskult-dbdump-state/r-jskult-dbdump-state.json +++ b/stepfunctions/r-jskult-dbdump-state/r-jskult-dbdump-state.json @@ -28,9 +28,9 @@ } }, "ResultPath": "$.params", - "Next": "exec-batch-monthly" + "Next": "exec-dbdump" }, - "exec-batch-monthly": { + "exec-dbdump": { "Comment": "実消化&アルトマーク 日次dump取得起動", "Type": "Task", "Resource": "arn:aws:states:::ecs:runTask.sync",