I’m trying to mount an EBS volume which persists even if task restarts (will be used by a self managed database engine). So I know adding it to task managed by service won’t work since it destroys my EBS on restarts.
Then I attached the EBS on my Launch Template (with deleteOnTerminate=false) which is used by the ASG on ECS container instances (ec2). AFAIK I can’t have more than 1 instance on my ASG, let me explain why, If I set desired to 2 on ASG it might launch 2 EC2 on same AZ, and each instance will have its own EBS, so even with az placement constraint I can’t guarantee to get the correct ebs.
So my final solution will be use max 1 instances on ASG but I’m thinking if it’s the best solution at all.
Any suggestions here folks ?