The use of pre- and post-snapshot scripts integrated in AWS Systems Manager documents is now supported by Amazon Data Lifecycle Manager
After completing the necessary steps, like tagging your SSM documents, setting up an IAM role for DLM, and onboarding your EC2 instance to AWS Systems Manager, all you need to do is create a lifecycle policy, tag the relevant Amazon Elastic Compute Cloud (EC2) instances
Because EBS snapshots are crash-consistent, they show the state of the corresponding EBS volume as of the snapshot creation date. For many kinds of applications, even those that don’t employ snapshots
Pre-snapshot scripts can handle pending transactions, stop the program or database, freeze the filesystem, and flush in-memory data to persistent storage
For EBS volumes connected to the instance, multi-volume EBS snapshots are started; more management is available through the policy
In addition to being recorded and published in Amazon CloudWatch metrics and Amazon EventBridge events, the status is also encoded in tags that are automatically applied to every snapshot
A pre-snapshot script ought to, for instance, fork a background task that functions as a backup in the event that the post-snapshot script malfunctionsFor more details visit govindhtech.com