Menu
AWS Glue
Developer Guide

Triggers

Data Types

Trigger Structure

Information about a specific trigger.

Fields

  • Name – String, matching the Single-line string pattern.

    Name of the trigger.

  • Id – String, matching the Single-line string pattern.

    Reserved for future use.

  • Type – String (valid values: SCHEDULED | CONDITIONAL | ON_DEMAND).

    The type of trigger that this is.

  • State – String (valid values: CREATING | CREATED | ACTIVATING | ACTIVATED | DEACTIVATING | DEACTIVATED | DELETING | UPDATING).

    The current state of the trigger.

  • Description – Description string, matching the URI address multi-line string pattern.

    A description of this trigger.

  • Schedule – String.

    A cron expression used to specify the schedule (see Time-Based Schedules for Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would specify: cron(15 12 * * ? *).

  • Actions – An array of Actions.

    The actions initiated by this trigger.

  • Predicate – A Predicate object.

    The predicate of this trigger, which defines when it will fire.

TriggerUpdate Structure

A structure used to provide information used to update a trigger. This object will update the the previous trigger definition by overwriting it completely.

Fields

  • Name – String, matching the Single-line string pattern.

    Reserved for future use.

  • Description – Description string, matching the URI address multi-line string pattern.

    A description of this trigger.

  • Schedule – String.

    A cron expression used to specify the schedule (see Time-Based Schedules for Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would specify: cron(15 12 * * ? *).

  • Actions – An array of Actions.

    The actions initiated by this trigger.

  • Predicate – A Predicate object.

    The predicate of this trigger, which defines when it will fire.

Predicate Structure

Defines the predicate of the trigger, which determines when it fires.

Fields

  • Logical – String (valid values: AND).

    Currently "OR" is not supported.

  • Conditions – An array of Conditions.

    A list of the conditions that determine when the trigger will fire.

Condition Structure

Defines a condition under which a trigger fires.

Fields

  • LogicalOperator – String (valid values: EQUALS).

    A logical operator.

  • JobName – String, matching the Single-line string pattern.

    The name of the Job to whose JobRuns this condition applies and on which this trigger waits.

  • State – String (valid values: STARTING | RUNNING | STOPPING | STOPPED | SUCCEEDED | FAILED).

    The condition state. Currently, the only value reported is SUCCEEDED.

Action Structure

Defines an action to be initiated by a trigger.

Fields

  • JobName – String, matching the Single-line string pattern.

    The name of a job to be executed.

  • Arguments – An array of UTF-8 string–to–UTF-8 string mappings.

    Arguments to be passed to the job.

    You can specify arguments here that your own job-execution script consumes, as well as arguments that AWS Glue itself consumes.

    For information about how to specify and consume your own Job arguments, see the Developer Guide Python programming topic.

    AWS Glue consumes the following arguments to set up the Job script environment:

    • --scriptLocation  —  The S3 location where your ETL script is located (in a form like s3://path/to/my/script.py). This overrides a script location set in the JobCommand object.

    • --extra-py-files  —  S3 path(s) to additional Python modules that AWS Glue will add to the Python path before executing your script. Multiple values must be complete paths separated by a comma (,). Note that only pure Python modules will work currently. Extension modules written in C or other languages are not supported.

    • --extra-jars  —  S3 path(s) to additional Java .jar file(s) that AWS Glue will add to the Java classpath before executing your script. Multiple values must be complete paths separated by a comma (,).

    • --extra-files  —  S3 path(s) to additional files such as configuration files that AWS Glue will copy to the working directory of your script before executing it. Multiple values must be complete paths separated by a comma (,).

    • --job-bookmark-option  —  When this argument is present, bookmarking is enabled, so that a JobRun starts from where the last one left off.

    • --TempDir  —  Specifies an S3 path to a bucket that can be used as a temporary directory for the Job.

    There are several argument names used by AWS Glue internally that you should never set:

    • --conf  —  Internal to AWS Glue. Do not set!

    • --debug  —  Internal to AWS Glue. Do not set!

    • --mode  —  Internal to AWS Glue. Do not set!

    • --JOB_NAME  —  Internal to AWS Glue. Do not set!

Operations

CreateTrigger Action (Python: create_trigger)

Creates a new trigger.

Request

  • Name – String, matching the Single-line string pattern. Required.

    The name of the trigger.

  • Type – String (valid values: SCHEDULED | CONDITIONAL | ON_DEMAND). Required.

    The type of the new trigger.

  • Schedule – String.

    A cron expression used to specify the schedule (see Time-Based Schedules for Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would specify: cron(15 12 * * ? *).

    This field is required when the trigger type is SCHEDULED.

  • Predicate – A Predicate object.

    A predicate to specify when the new trigger should fire.

    This field is required when the trigger type is CONDITIONAL.

  • Actions – An array of Actions. Required.

    The actions initiated by this trigger when it fires.

  • Description – Description string, matching the URI address multi-line string pattern.

    A description of the new trigger.

Response

Errors

  • AlreadyExistsException

  • InvalidInputException

  • InternalServiceException

  • OperationTimeoutException

  • ResourceNumberLimitExceededException

  • ConcurrentModificationException

StartTrigger Action (Python: start_trigger)

Starts an existing trigger. See Triggering Jobs for information about how different types of trigger are started.

Request

Response

Errors

  • InvalidInputException

  • InternalServiceException

  • EntityNotFoundException

  • OperationTimeoutException

  • ResourceNumberLimitExceededException

  • ConcurrentRunsExceededException

GetTrigger Action (Python: get_trigger)

Retrieves the definition of a trigger.

Request

Response

  • Trigger – A Trigger object.

    The requested trigger definition.

Errors

  • EntityNotFoundException

  • InvalidInputException

  • InternalServiceException

  • OperationTimeoutException

GetTriggers Action (Python: get_triggers)

Gets all the triggers associated with a job.

Request

  • NextToken – String.

    A continuation token, if this is a continuation call.

  • DependentJobName – String, matching the Single-line string pattern.

    The name of the job for which to retrieve triggers. The trigger that can start this job will be returned, and if there is no such trigger, all triggers will be returned.

  • MaxResults – Number (integer).

    The maximum size of the response.

Response

  • Triggers – An array of Triggers.

    A list of triggers for the specified job.

  • NextToken – String.

    A continuation token, if not all the requested triggers have yet been returned.

Errors

  • EntityNotFoundException

  • InvalidInputException

  • InternalServiceException

  • OperationTimeoutException

UpdateTrigger Action (Python: update_trigger)

Updates a trigger definition.

Request

  • Name – String, matching the Single-line string pattern. Required.

    The name of the trigger to update.

  • TriggerUpdate – A TriggerUpdate object. Required.

    The new values with which to update the trigger.

Response

  • Trigger – A Trigger object.

    The resulting trigger definition.

Errors

  • InvalidInputException

  • InternalServiceException

  • EntityNotFoundException

  • OperationTimeoutException

  • ConcurrentModificationException

StopTrigger Action (Python: stop_trigger)

Stops a specified trigger.

Request

Response

Errors

  • InvalidInputException

  • InternalServiceException

  • EntityNotFoundException

  • OperationTimeoutException

  • ConcurrentModificationException

DeleteTrigger Action (Python: delete_trigger)

Deletes a specified trigger. If the trigger is not found, no exception is thrown.

Request

Response

Errors

  • InvalidInputException

  • InternalServiceException

  • OperationTimeoutException

  • ConcurrentModificationException