- Mais recentes
- Mais votos
- Mais comentários
The behavior you're experiencing with EventBridge Scheduler is not a bug, but rather a result of how the update operation works with schedules.
When you update a schedule using the UpdateSchedule operation (which your Lambda is doing via boto3), if you don't explicitly include the EndDate parameter in your update request, it will default to null. This effectively removes the end date constraint from your schedule, causing it to run indefinitely.
In your Lambda code, you're updating the schedule with the current fire time, but you're not preserving the original EndDate value. This is why your schedule continues to run even after what should have been its end date - the update operation is removing that constraint.
To fix this issue, you need to ensure that when you update the schedule, you include the original EndDate parameter if you want to maintain that constraint. Otherwise, the schedule will continue running indefinitely as a rate-based schedule with no end date.
If you want to stop a schedule from running after a certain point, you have two options:
- Always include the EndDate in your update operations
- Change the state of the schedule to DISABLED when you detect it should no longer run (using the --state DISABLED parameter)
Rate-based schedules should respect the EndDate parameter when it's properly set and maintained through updates.
Sources
UpdateSchedule - EventBridge Scheduler
Schedule types in EventBridge Scheduler - EventBridge Scheduler
Changing the schedule state in EventBridge Scheduler - EventBridge Scheduler
Conteúdo relevante
- feita há 4 meses
