LoginSignup
1
0

More than 1 year has passed since last update.

Cloudformationを用いて、Crawler完了時にJobを実行させるAWS::Glue::Triggerを作成する際の注意点

Last updated at Posted at 2021-08-05

環境

2021/08/05時点での情報です。

問題

公式マニュアルに則り以下のようにTriggerを記述したが、
スタック生成時に"state cannot be null or empty, choose from one of the following crawler state: [succeeded, failed, cancelled]"とエラーが生じる。

AWSTemplateFormatVersion: 2010-09-09
Resources:
  GlueJobTrigger:
    Type: AWS::Glue::Trigger
    Properties:
      Type: CONDITIONAL
      Actions:
        - JobName: JobName
          Arguments:
            "--job-bookmark-option": "job-bookmark-enable"
      Predicate:
        Conditions:
          - LogicalOperator: EQUALS
            State: SUCCEEDED
            CrawlerName: CrawlerName
      StartOnCreation: true
      Name: GlueJobTrigger

原因

StateではなくCrawlStateと指定する必要がある。

AWSTemplateFormatVersion: 2010-09-09
Resources:
  GlueJobTrigger:
    Type: AWS::Glue::Trigger
    Properties:
      Type: CONDITIONAL
      Actions:
        - JobName: JobName
          Arguments:
            "--job-bookmark-option": "job-bookmark-enable"
      Predicate:
        Conditions:
          - LogicalOperator: EQUALS
            # State: SUCCEEDED
            CrawlState: SUCCEEDED
            CrawlerName: CrawlerName
      StartOnCreation: true
      Name: GlueJobTrigger

最後に

同じようなエラーで困っている方の役に立てれば幸いです。

1
0
1

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
1
0