Ah, I gotcha.
Yevgeniy Brikman

The reattaching you describe is exactly the problem that Consul’s lock sessions solve. You use a small script wrapped as a service on the instance to claim a lock on the EBS volume at assignment time with a TTL expiry of however long you want to wait, we usually use 60 seconds. If the instance does not renew the lock, then the session is deleted and the volume is available to be claimed by a replacement instance.

Like what you read? Give Ralph Tice a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.