How to make java war file load configuration properties from external URL to deploy on AWS Elastic Beanstlk

I have created a project using JHipster (Spring Boot) and bundled it with a .war file. The application is working fine when deployed to AWS EC2 instance.

Now the management wants me to deploy it on AWS Elastic Beanstalk and move all the configurations outside the .war file. For instance, The DB connection, email configuration, PayPal configuration not to be bundled with the .war file, whereas, it should load the properties from external resource like S3.

Can someone please help how can I change the application.yml and application-dev.yml etc to load values from some external source?


ANSWERS:


Take a look to Spring Cloud Config, which is initially meant to be used on spring cloud microservices, but can be used in order to solve your problem.

The approach here is, that in the early boot up phase your application connects to a spring cloud config server, to get external configuration. More on this, you can change several config properties, while your deployed application is running.

For the storage, cloud config enables git for production use case to store your configs, and I am pretty sure you can somehow use S3 for this...if needed.



 MORE:


 ? "No 'Access-Control-Allow-Origin' header is present on the requested resource"
 ? Check number of arguments passed to a Bash script
 ? 'size' vs 'ls -l' to get the size of an executable file
 ? Newbie: unix bash, nested if statement, results from a loop results from sql
 ? Installed Git, but accidentally deleted a file. Now I'm lost
 ? "Too many arguments" error in shell script
 ? Keep unique lines only, searching entire directory
 ? How to avoid 'are the same file' warning message when using cp in Linux?
 ? My python installation on 1and1 stopped working (bashrc issue)
 ? How do I turn the beep slash bell off in cygwin?