0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AWS BatchのSubmitJobで「Reason The field 'parameters' is not supported」みたいなエラーが出るときの対処

Posted at

AWS BatchのSubmitJobで「Reason The field 'parameters' is not supported」みたいなエラーが出ました。
ちょっと解決に時間がかかったのでメモしておきます。

やりたかった事

  • AWS Batchで決められた時間にS3のファイルを別の所に移動したい
  • EventBridgeで定期実行する
  • Lambdaは挟まないでSubmitJobしたい
  • バッチの内部で日付取得し処理に使っているがジョブ失敗の時に備えて外部から日付パラメータを渡せるようにしたい

EventBridgeの設定

AWS Batchのよくある定期実行系の記事ではLambdaを挟む方法がほとんどですが、
今回はEventBridgeスケジューラで直接SubmitJobしています

image.png

問題となった箇所

parametersの定義で以下のように先頭小文字にして登録しようとしていました。

{
    "JobDefinition": "sample-batch",
    "JobName": "sample-batch",
    "JobQueue": "sample-job",
    "parameters": {
        "targetDate": "none"
    }
}

この状態だと以下のようなエラーが出ます。

Invalid RequestJson provided. Reason The field 'parameters' is not supported by api 'submitJob' for the service 'aws-sdk:batch'.

解決法

下記参考URLにてCamelCaseで書くといけるとの情報で無事登録できました。

Parameters in Step Functions are expressed in CamelCase, even when the native service API is pascalCase.
{
    "JobDefinition": "sample-batch",
    "JobName": "sample-batch",
    "JobQueue": "sample-job",
-    "parameters": {
+    "Parameters": {
        "targetDate": "none"
    }
}

参考

AWS Step cannot correctly invoke AWS Batch job with complex parameters

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?