AWS Elastic beantalk和Springboot配置

时间:2019-03-17 12:18:08

标签: spring amazon-web-services spring-boot configuration amazon-elastic-beanstalk

我有多个AWS Elastic beantalk环境,并且在每个环境中,Springboot应用程序资源文件夹中的配置都不同,如下所示:

application-PL.properties
application-GB.propeties

我这样加载此配置:

@PropertySources({
        @PropertySource("classpath:application.properties"),
        @PropertySource(value = "classpath:application-${context.country}.properties", ignoreResourceNotFound = true)
})

application.propeties中,我定义了上下文国家:

context.country=GB

这对于开发目的非常有效,但是每次我要将应用程序部署到特定环境时,都必须在构建应用程序之前更改context.country。我可以编写Gradle脚本来更改属性文件中的值,但我想知道是否可以在AWS Elastic beantalk环境中以某种方式设置context.country,以便它优先于application.propeties中编写的内容。 / p>

有什么建议吗?

0 个答案:

没有答案
相关问题