If your application has something regarding its state saved on a disk, you need to remove it before applying Auto Scaling. What was previously saved as files in the EC2 machine must be removed and managed by a service. There are two options which are as follows:
-
AWS Elastic File System (https://aws.amazon.com/efs/): In a few words, this is a network file system that is mounted in your EC2 machine with virtually infinite space where you only pay for the space used by your file.
-
AWS S3 (https://aws.amazon.com/s3/): This was the first AWS service on the market and is an object storage designed to deliver 99.999999999% durability.
In general, the S3 should be your favorite solution, but it is not ...