S3中的Spring启动配置 - AWS beanstalk

时间:2017-02-15 01:07:11

标签: amazon-s3 spring-boot configuration amazon-elastic-beanstalk

我在AWS beanstalk中运行了aspring启动应用程序。它目前从src/main/resources/application.properties文件中读取属性。我希望通过在S3中将属性作为文件提供来覆盖这些配置。因此,我在S3 s3://my-bucket/some_dir/application.properties处创建了一个文件。在beanstalk应用程序中,我在软件配置中提供了以下设置。

spring.config.location,其值为s3://my-bucket/some_dir/application.properties

重新启动应用,但我仍然看到旧值。我遵循了文档here

我做错了什么?

1 个答案:

答案 0 :(得分:1)

那是行不通的。 Spring不仅仅了解s3:// URL。为您的应用创建启动脚本,首先下载该文件,然后使用--spring.config.locations将其传递到您的应用。