Ah, I gotcha.
Yevgeniy Brikman
1

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.

Show your support

Clapping shows how much you appreciated Ralph Tice’s story.