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-triggerto disable. - Use
start-triggerto 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
- AWS CLI Command Reference: stop-trigger
- AWS CLI Command Reference: start-trigger
- AWS Glue Triggers Documentation: AWS Glue Triggers