Using configuration parameters obtained dynamically instead of Configuration file (For using AWS Parameter Store service)

41 views
Skip to first unread message

Sharath

unread,
Mar 9, 2018, 2:28:33 AM3/9/18
to Play Framework
Hi,
We are trying to implement AWS Parameter Store service for centrally storing configuration parameters, and for security reasons.
So we wanted to know if there is any way in Play Framework to have the configurations such as database credentials to be loaded dynamically during the server start-up, instead of having to load it from configuration files? I know that we can use environment variables inside the configuration files, but that is not what we're looking for.
Basically, we do not want someone who gets access to the server instance(AWS EC2 through SSH) to be able to obtain the application configuration parameters like database credentials.

Thanks,
Sharath



Matthias Kurz

unread,
Mar 9, 2018, 6:14:46 AM3/9/18
to Play Framework
Yes, that should be possible.

You need to write your own GuiceApplicationLoader and override its builder(...) method.
Have a look here:

Have a look at the .loadConfig(...) line. In your case you need to pass a Config object which you filled with the configs from the AWS Parameter Store service.

Regards,
Matthias
Reply all
Reply to author
Forward
0 new messages