Resource: aws_glue_trigger

Manages a Glue Trigger resource.

Example Usage

Conditional Trigger

resource "aws_glue_trigger" "example" {
  name = "example"
  type = "CONDITIONAL"

  actions {
    job_name = aws_glue_job.example1.name
  }

  predicate {
    conditions {
      job_name = aws_glue_job.example2.name
      state    = "SUCCEEDED"
    }
  }
}

On-Demand Trigger

resource "aws_glue_trigger" "example" {
  name = "example"
  type = "ON_DEMAND"

  actions {
    job_name = aws_glue_job.example.name
  }
}

Scheduled Trigger

resource "aws_glue_trigger" "example" {
  name     = "example"
  schedule = "cron(15 12 * * ? *)"
  type     = "SCHEDULED"

  actions {
    job_name = aws_glue_job.example.name
  }
}

Conditional Trigger with Crawler Action

Note: Triggers can have both a crawler action and a crawler condition, just no example provided.

resource "aws_glue_trigger" "example" {
  name = "example"
  type = "CONDITIONAL"

  actions {
    crawler_name = aws_glue_crawler.example1.name
  }

  predicate {
    conditions {
      job_name = aws_glue_job.example2.name
      state    = "SUCCEEDED"
    }
  }
}

Conditional Trigger with Crawler Condition

Note: Triggers can have both a crawler action and a crawler condition, just no example provided.

resource "aws_glue_trigger" "example" {
  name = "example"
  type = "CONDITIONAL"

  actions {
    job_name = aws_glue_job.example1.name
  }

  predicate {
    conditions {
      crawler_name = aws_glue_crawler.example2.name
      crawl_state  = "SUCCEEDED"
    }
  }
}

Argument Reference

This resource supports the following arguments:

Actions

Notification Property

Predicate

Conditions

Event Batching Condition

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import Glue Triggers using name. For example:

import {
  to = aws_glue_trigger.MyTrigger
  id = "MyTrigger"
}

Using terraform import, import Glue Triggers using name. For example:

% terraform import aws_glue_trigger.MyTrigger MyTrigger