I have a multi-environment system for which I have spring profiles assigned. I'd like to be able to assign those profiles based on an environment specific application.properties file.
So far, everything I've read about being able to add additional resource path to spring involves creating a bean and overriding or altering PropertySourcesPlaceholderConfiguration. This however, happens AFTER spring loads profiles (and a few other properties which I'd like to dynamically set).
Is there any way to tell Spring to look for application.properties in S3 prior to it doing anything else?
Create a script to run your application that:
Download the appropriate file from s3. Something like (or any other method):
s3 cp s3://mybucket/custom.properties custom.properties
Run your app with -Dspring.config.location
java -jar your-jar.jar -Dspring.config.location=custom.properties