ElasticBeanstalk Java, spring active profile
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
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
Similarly With AWS LAMBDA:
In $ sam local
you add the following line in your sam template yml file:
Resources:
FunctionName:
Properties:
Environment:
Variables:
SPRING_PROFILES_ACTIVE: local
But in AWS Console: in your Lambda Environment variables just add:
KEY:JAVA_TOOL_OPTIONS
VALUE:-Dspring.profiles.active=dev
The casing is different when set as an Environment Variable versus the command line property. Try setting SPRING_PROFILES_ACTIVE in your EB Configuration.