Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticBeanstalk Java, spring active profile

I am trying to start a spring boot .jar via AWS ElasticBeanstalk. Everything works fine, with the profile "default". Does anybody know how to set the active profile(spring.profiles.active) for a java ElasticBeanstalk app(not tomcat). I always get "No active profile set, falling back to default profiles: default". Is there a way to directly set vm options?

I already set a "spring.profiles.active" Environment Property in AWS Admin Console, but it doesn't work.

Thanks and Best Regards Alex

like image 770
Alex Haider Avatar asked Aug 18 '16 15:08

Alex Haider


3 Answers

The casing is different when set as an Environment Variable versus the command line property. Try setting SPRING_PROFILES_ACTIVE in your EB Configuration.

like image 68
Thorn G Avatar answered Oct 17 '22 21:10

Thorn G


ElasticBeanStack Web UI has a tab named Configuration. Inside that,there will be a Box (Card ) named software Configuration. There you need to set SPRING_PROFILES_ACTIVE to prod

enter image description here

enter image description here

like image 22
sapy Avatar answered Oct 17 '22 21:10

sapy


AWS EB doesn't pass variables with dots in names to deployed app. You have to replace dots with underscores and use upper case, e.g.:

SPRING_PROFILES_ACTIVE=prod
like image 38
Boris Avatar answered Oct 17 '22 22:10

Boris