Intent:我正在开发一个 POC,打算使用 AWS 参数存储作为属性存储。这会将机密应用程序属性存储在 AWS SSM 的参数存储中。我正在使用 Java 8 和 spring boot/cloud 版本 2。
Resource: 我跟着本参考指南 http://cloud.spring.io/spring-cloud-static/spring-cloud-aws/2.0.0.RELEASE/multi/multi__cloud_environment.html#_integrating_your_spring_cloud_application_with_the_aws_parameter_store来自春季文档
和
也是一篇综合性的文章将 AWS Parameter Store 与 Spring Cloud 集成 https://blog.trifork.com/2018/07/20/integrating-the-aws-parameter-store-with-spring-cloud/.因此试图利用
spring-cloud-starter-aws-parameter-store-config.jar
因此在构建文件中添加了所需的依赖项。
预期输出:
实际产量 :
Here is 来自 AWS 控制台的快照我正在尝试从 AWS 参数存储访问下面显示的参数
以下是我的弹簧属性文件:
应用程序.yml
bootstrap.yml
我正在使用具有以下依赖项的 MavenPOM.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-aws-parameter-store-config</artifactId>
</dependency>
</dependencies>
我在这里错过了什么吗?如果有人已经遇到并解决了这个问题,请告诉我。
我可以从命令行输入和获取参数,但它只是无法让这个 java lib 工作。
我正在尝试的示例的 GitHub 存储库 -
GitHub 存储库链接 https://github.com/MaheshLoya/springcloud-aws-paramstore-integration-sample/tree/master