Amazon Web Services – Deploy AWS Without Deleting Files

amazon ec2amazon-web-services

I'm new to AWS and I'm having trouble with deploying a project. Every time I deploy using the CLI, all the files created by my application is wiped.

Now I'm sure I'm just falling victim to my own incompetence, but I'm having a hard time tracking down the right process/design to ensure that I can keep some parts of my data while updating. I suspect I have to save the data to another location outside of the local server, but I'm not clear on how to approach that.

Any pointers would be appreciated.

Best Answer

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)