0

I have a web app running on AWS Elastic Beanstalk with load balancing/auto scaling. I have added various property files within the EC2 instance via ssh. If the app gets autoscaled then those files I created will be lost. Is there a way so if it does get autoscaled, those files will go into the new autoscaled instance? Hope this makes sense? I did read this here, but still unsure customizing software on linux servers

Thanks

Mark B
  • 183,023
  • 24
  • 297
  • 295
Steve Green
  • 79
  • 1
  • 10
  • Property files and to a lesser extent environment variables isn't the right way to configure your serverless architecture. You could consider AWS Parameter Store. Post your coding framework to get further advise. – kgiannakakis Dec 03 '21 at 13:26
  • Unfortunately this is a legacy app, so would need code changes if not using these property files. Code framework is Spring Boot / Java / Javascript. Property files are used to use different database connections based on if live release or a qa release and a few various other things. – Steve Green Dec 03 '21 at 13:34
  • On AWS the abbreviation EBS stands for Elastic Block Store. Elastic Beanstalk would be "EB". – Mark B Dec 03 '21 at 14:13
  • 1
    https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebextensions.html – Mark B Dec 03 '21 at 14:18
  • 1
    @SteveGreen You then perhaps could use environmental variables (https://stackoverflow.com/questions/35531661/using-env-variable-in-spring-boots-application-properties). Minimal changes should be needed to bundle a new application properties file into the app. – kgiannakakis Dec 03 '21 at 14:19
  • Thanks all for the advice, just looking into AWS Param store atm and environment variables (use this a lot with my AWS Lambda's). – Steve Green Dec 06 '21 at 09:51

1 Answers1

1

Best way would be to save those property files outside the EC2 instance for example in an S3 bucket or to a shared disk; So you could seed these with an ebextension on each new instance (example)

I also have an EB application where is highly undesirable. I made a worker instance for this web application which is not auto scaled but I scale this worker instance vertically (bigger instance size). For this application the property files were used for async tasks like sending notifications/emails; The communication for the web instance and worker instance are done via SQS.

Max Visser
  • 577
  • 4
  • 10