skip to Main Content

I am transferring an existing PHP application to the Elastic Beanstalk and have a newbie question. My application has a data folder that grows and changes over time and can grow quite large currently the folder is a subfolder in the root directory of the application. In the traditional development model I just upload the changed PHP files are carry on using the same data folder, how can I do this in the Elastic Beanstalk?

I dont want to have to download and upload the data folder everytime I deploy a new version of the application. What is the best practice to do this in the AWS Beanstalk?

TIA

Peter

2

Answers


  1. This is a question of continious deployment.

    Elastic BeanStalk supports CD from AWS CodePipeline: https://aws.amazon.com/getting-started/tutorials/continuous-deployment-pipeline/

    To address “grows and changes over time and can grow quite large currently the folder is a subfolder in the root directory of the application”, you can use CodeCommit to version your code using Git. If you version the data folder with your application, the deployment will include it.

    If the data is something you can offload to an object store (S3) or a database (RDS/DynamoDB/etc), it would be a better practice to do so.

    Login or Signup to reply.
  2. As per the AWS documentation here, Elastic Beanstalk applications run on EC2 instances that have no persistent local storage, as a result your EB application should be as stateless as possible, and should use persistent storage from one of the storage offerings offered by AWS.

    A common strategy for persistent storage is to use Amazon EFS, or Elastic File Service. As noted in the documentation for using EFS with Elastic Beanstalk here:

    Your application can treat a mounted Amazon EFS volume like local storage, so you don’t have to change your application code to scale up to multiple instances.

    Your EFS drive is essentially a mounted network drive. Files stored in EFS will be accessible across any instances that have the file system mounted, and will persist beyond instance termination and/or scaling events.

    You can learn more about EFS here, and using EFS with Elastic Beanstalk here.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search