Score:0

AWS Deploy without deleting files

et flag

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.

vn flag
There are many ways of deploying on AWS. What method are you using?
et flag
I'm using the command line interface from Visual Code with the command "eb deploy". Version is EB CLI 3.20.2 (Python 3.10.).
vn flag
OK, so you're using Elastic Beanstalk. https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/concepts.concepts.design.html#concepts.concepts.design.storage "Elastic Beanstalk applications run on Amazon EC2 instances that have no persistent local storage. When the Amazon EC2 instances terminate, the local file system is not saved, and new Amazon EC2 instances start with a default file system. You should design your application to store data in a persistent data source. "
et flag
Ok, but what constitutes a persistent data source? It’s a few simple json files.
Tim avatar
gp flag
Tim
Persistent data stores such as RDS SQL database, DynamoDB NoSQL database, S3 object store, EFS which you can map as a drive from all ECS instances. Even a shared EBS volume is an option, but EBS is typically preferred over that. You should treat servers like cattle, not pets.
et flag
That makes a lot of sense, so even for a file, I should be persisting it on a file server. Thank you for taking the time to clarify, I figured it was my lack of knowledge. I really appreciate the feedback.
Tim avatar
gp flag
Tim
I will convert my comment to an answer so you can close the question off.
Score:1
gp flag
Tim

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)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.