I want to detach and attach an EBS volume on schedule.
Here is the flow example: I have 10 EC2 instances and each run a copy of my app. This app/api serves data that is on EBS volume attached to the instance. We want to refresh data every night on these instances taking one instance out of the service pool at a time. To minimize downtime of our instances, we'd create data volumes with new data in the background and once the data is ready we'd want to replace the EBS volumes. I want to do this every night for a bunch of instances: stop instance --> detach old volume --> attach new volume --> mount new volume --> restart app
What's the best way to achieve this?