AWS Deploy without deleting files
Generally it's better to treat your instances as temporary as this makes scaling, backups, etc simpler. "Cattle not pets" is the general principal.
To enable this approach put your data onto a persistent data store such as:
- EFS (which you can map as a drive from all ECS instances)
- Shared EBS volume is an option (EFS typically better)
- RDS SQL database
- DynamoDB NoSQL database
- S3 object store (which you can map as a drive with the right software)