简体   繁体   English

如何在AWS上定义弹簧轮廓

[英]How to define spring profile on AWS

I have deployed my war file on AWS's Elastic Beanstalk as a java app. 我已将我的war文件部署在AWS的Elastic Beanstalk上作为java应用程序。

I want to specify on AWS : spring.profiles.active like I do when I execute: 我想在AWS上指定:spring.profiles.active就像我执行时一样:

java -jar -Dspring.profiles.active=prod target/gaming-boost-0.0.1-SNAPSHOT.war

I can only configure "Environment Property" on "Configuration" 我只能在“配置”上配置“环境属性”

在ElasticBeanStalk中设置以下环境变量

SPRING_PROFILES_ACTIVE=prod

Take a look at https://stackoverflow.com/a/39021794/2135973 看看https://stackoverflow.com/a/39021794/2135973

The casing is different when set as an Environment Variable versus the command line property. 设置为环境变量与命令行属性时,外壳不同。 Try setting SPRING_PROFILES_ACTIVE in your EB Configuration. 尝试在EB配置中设置SPRING_PROFILES_ACTIVE。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM