如何在AWS上定义Spring Profile [英] How to define spring profile on AWS

查看:134
本文介绍了如何在AWS上定义Spring Profile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将War文件作为Java应用程序部署在AWS的Elastic Beanstalk上.

I have deployed my war file on AWS's Elastic Beanstalk as a java app.

我想在AWS上指定:spring.profiles.active,就像执行时一样:

I want to specify on AWS : spring.profiles.active like I do when I execute:

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

我只能在配置"上配置环境属性"

I can only configure "Environment Property" on "Configuration"

推荐答案

在ElasticBeanStalk中设置以下环境变量

Set below environment variable in ElasticBeanStalk

SPRING_PROFILES_ACTIVE=prod

这篇关于如何在AWS上定义Spring Profile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆