Skip to content

Conversation

@gsavage
Copy link
Contributor

@gsavage gsavage commented Nov 28, 2025

When access is granted, an EventBridgeSchedule is created to fire when access should be revoked. However the schedules are not deleted, and so the list of schedules continues to grow, for ever.

This has the knock-on effect of making the revoke lambda run slower and slower, as it has to paginate through more and more old schedules.

This commit sets the ActionAfterCompletion property on the schedule so that once it has executed AWS will delete it. This means that the number of schedules should remain fairly constant over a given period of time.

Note that I have not included anything here to delete old schedules, so tidying-up an existing installation will be something that each team will need to perform manually.


Note

Sets ActionAfterCompletion=DELETE on all created EventBridge schedules so they are removed after firing.

  • Scheduler:
    • Set ActionAfterCompletion to DELETE for schedules created in:
      • schedule_revoke_event
      • schedule_group_revoke_event
      • schedule_discard_buttons_event
      • schedule_approver_notification_event

Written by Cursor Bugbot for commit be0f8c1. This will update automatically on new commits. Configure here.

When access is granted, an EventBridgeSchedule is created to fire when
access should be revoked.  However the schedules are not deleted, and so
the list of schedules continues to grow, for ever.

This has the knock-on effect of making the revoke lambda run slower
and slower, as it has to paginate through more and more old schedules.

This commit sets the ActionAfterCompletion property on the schedule so
that once it has executed AWS will delete it.  This means that the
number of schedules should remain fairly constant over a given period of
time.

Note that I have not included anything here to delete old schedules, so
tidying-up an existing installation will be something that each team
will need to perform manually.
@Andrey9kin
Copy link
Member

@gsavage good catch! Thanks for sending the PR!

@Andrey9kin Andrey9kin merged commit 4416585 into fivexl:main Nov 28, 2025
6 checks passed
@Andrey9kin
Copy link
Member

Released 4.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants