Geek Logbook

Tech sea log book

How to Disable an AWS Glue Trigger from the CLI

When working with AWS Glue, triggers are an important mechanism to orchestrate jobs or workflows. Sometimes, however, you may need to temporarily disable a trigger without deleting it—for example, to pause scheduled ingestions during maintenance or testing. This article explains how to disable a trigger using the AWS CLI.


Understanding AWS Glue Triggers

AWS Glue supports different types of triggers:

  • On-demand triggers: started manually.
  • Event-based triggers: started when specific conditions are met.
  • Scheduled triggers: run at predefined times (e.g., daily at 12:00 PM).

Each trigger can be in one of the following states:

  • ACTIVATED: enabled and will execute as scheduled or when conditions are met.
  • DEACTIVATED: disabled and will not run until re-enabled.

The Problem

A common mistake is attempting to disable a trigger using:

aws glue update-trigger --name my-trigger --trigger-update '{"State": "DISABLED"}'

This fails because State is not a valid parameter in update-trigger. Instead, AWS Glue provides explicit commands to start or stop triggers.


The Correct Way to Disable a Trigger

To disable (stop) a trigger:

aws glue stop-trigger --name sales-data-trigger

This will change the trigger state from ACTIVATED to DEACTIVATED, preventing it from firing until re-enabled.

To re-enable (start) the trigger:

aws glue start-trigger --name sales-data-trigger

Verifying the Trigger State

You can confirm the current status of your trigger by running:

aws glue get-trigger --name sales-data-trigger

The output will include:

{
    "Trigger": {
        "Name": "sales-data-trigger",
        "Type": "SCHEDULED",
        "TriggerState": "DEACTIVATED",
        "Schedule": "cron(0 12 * * ? *)",
        ...
    }
}

Conclusion

Disabling a trigger in AWS Glue is straightforward once you know the correct commands:

  • Use stop-trigger to disable.
  • Use start-trigger to re-enable.

This allows you to pause or resume orchestrated jobs without having to delete or recreate triggers, offering more control over your ETL pipelines.


References

Tags: