App Shutdown Trigger
This trigger allows you to execute flows after all other triggers in the app are successfully stopped. It can be used to specify shutdown logic that is specific to an app. For example, this trigger can be used for:
- Cleaning up data or cache
- Deleting tables from a database
Design considerations
- You can add one or more App Shutdown triggers to an app.
- You can add the App Shutdown trigger along with the Receive Lambda trigger, AWS API Gateway trigger, and S3 bucket Lambda trigger. You cannot add any other trigger along with the Receive Lambda trigger, AWS API Gateway trigger, and S3 bucket Lambda trigger.
- The trigger supports multiple handlers. So, you can configure more than one flow in the trigger.
- The flows are executed in the order in which they are configured in the trigger.
- The trigger is executed for all instances of the app. For example, if you scale down multiple instances of the app, the trigger is executed on each scale down.
- If an app is forcefully shut down, the trigger and subsequent flows are not executed. This trigger is executed only when an app is gracefully shut down.
-
In container deployments, the collective execution time of all flows configured to this type of trigger must not exceed the graceful-stop time set for the app.
- You must exercise caution while defining a flow in the App Shutdown trigger. For example, when an app is scaled to more than one instance, cleanup is done while shutting down one instance may impact other running instances.